This is page 1 of 20. Use http://codebase.md/trycua/cua?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .all-contributorsrc ├── .cursorignore ├── .devcontainer │ ├── devcontainer.json │ ├── post-install.sh │ └── README.md ├── .dockerignore ├── .gitattributes ├── .github │ ├── FUNDING.yml │ ├── scripts │ │ ├── get_pyproject_version.py │ │ └── tests │ │ ├── __init__.py │ │ ├── README.md │ │ └── test_get_pyproject_version.py │ └── workflows │ ├── ci-lume.yml │ ├── docker-publish-kasm.yml │ ├── docker-publish-xfce.yml │ ├── docker-reusable-publish.yml │ ├── npm-publish-computer.yml │ ├── npm-publish-core.yml │ ├── publish-lume.yml │ ├── pypi-publish-agent.yml │ ├── pypi-publish-computer-server.yml │ ├── pypi-publish-computer.yml │ ├── pypi-publish-core.yml │ ├── pypi-publish-mcp-server.yml │ ├── pypi-publish-pylume.yml │ ├── pypi-publish-som.yml │ ├── pypi-reusable-publish.yml │ └── test-validation-script.yml ├── .gitignore ├── .vscode │ ├── docs.code-workspace │ ├── launch.json │ ├── libs-ts.code-workspace │ ├── lume.code-workspace │ ├── lumier.code-workspace │ └── py.code-workspace ├── blog │ ├── app-use.md │ ├── assets │ │ ├── composite-agents.png │ │ ├── docker-ubuntu-support.png │ │ ├── hack-booth.png │ │ ├── hack-closing-ceremony.jpg │ │ ├── hack-cua-ollama-hud.jpeg │ │ ├── hack-leaderboard.png │ │ ├── hack-the-north.png │ │ ├── hack-winners.jpeg │ │ ├── hack-workshop.jpeg │ │ ├── hud-agent-evals.png │ │ └── trajectory-viewer.jpeg │ ├── bringing-computer-use-to-the-web.md │ ├── build-your-own-operator-on-macos-1.md │ ├── build-your-own-operator-on-macos-2.md │ ├── composite-agents.md │ ├── cua-hackathon.md │ ├── hack-the-north.md │ ├── hud-agent-evals.md │ ├── human-in-the-loop.md │ ├── introducing-cua-cloud-containers.md │ ├── lume-to-containerization.md │ ├── sandboxed-python-execution.md │ ├── training-computer-use-models-trajectories-1.md │ ├── trajectory-viewer.md │ ├── ubuntu-docker-support.md │ └── windows-sandbox.md ├── CONTRIBUTING.md ├── Development.md ├── Dockerfile ├── docs │ ├── .gitignore │ ├── .prettierrc │ ├── content │ │ └── docs │ │ ├── agent-sdk │ │ │ ├── agent-loops.mdx │ │ │ ├── benchmarks │ │ │ │ ├── index.mdx │ │ │ │ ├── interactive.mdx │ │ │ │ ├── introduction.mdx │ │ │ │ ├── meta.json │ │ │ │ ├── osworld-verified.mdx │ │ │ │ ├── screenspot-pro.mdx │ │ │ │ └── screenspot-v2.mdx │ │ │ ├── callbacks │ │ │ │ ├── agent-lifecycle.mdx │ │ │ │ ├── cost-saving.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── logging.mdx │ │ │ │ ├── meta.json │ │ │ │ ├── pii-anonymization.mdx │ │ │ │ └── trajectories.mdx │ │ │ ├── chat-history.mdx │ │ │ ├── custom-computer-handlers.mdx │ │ │ ├── custom-tools.mdx │ │ │ ├── customizing-computeragent.mdx │ │ │ ├── integrations │ │ │ │ ├── hud.mdx │ │ │ │ └── meta.json │ │ │ ├── message-format.mdx │ │ │ ├── meta.json │ │ │ ├── migration-guide.mdx │ │ │ ├── prompt-caching.mdx │ │ │ ├── supported-agents │ │ │ │ ├── composed-agents.mdx │ │ │ │ ├── computer-use-agents.mdx │ │ │ │ ├── grounding-models.mdx │ │ │ │ ├── human-in-the-loop.mdx │ │ │ │ └── meta.json │ │ │ ├── supported-model-providers │ │ │ │ ├── index.mdx │ │ │ │ └── local-models.mdx │ │ │ └── usage-tracking.mdx │ │ ├── computer-sdk │ │ │ ├── commands.mdx │ │ │ ├── computer-ui.mdx │ │ │ ├── computers.mdx │ │ │ ├── meta.json │ │ │ └── sandboxed-python.mdx │ │ ├── index.mdx │ │ ├── libraries │ │ │ ├── agent │ │ │ │ └── index.mdx │ │ │ ├── computer │ │ │ │ └── index.mdx │ │ │ ├── computer-server │ │ │ │ ├── Commands.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── REST-API.mdx │ │ │ │ └── WebSocket-API.mdx │ │ │ ├── core │ │ │ │ └── index.mdx │ │ │ ├── lume │ │ │ │ ├── cli-reference.mdx │ │ │ │ ├── faq.md │ │ │ │ ├── http-api.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── installation.mdx │ │ │ │ ├── meta.json │ │ │ │ └── prebuilt-images.mdx │ │ │ ├── lumier │ │ │ │ ├── building-lumier.mdx │ │ │ │ ├── docker-compose.mdx │ │ │ │ ├── docker.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── installation.mdx │ │ │ │ └── meta.json │ │ │ ├── mcp-server │ │ │ │ ├── client-integrations.mdx │ │ │ │ ├── configuration.mdx │ │ │ │ ├── index.mdx │ │ │ │ ├── installation.mdx │ │ │ │ ├── llm-integrations.mdx │ │ │ │ ├── meta.json │ │ │ │ ├── tools.mdx │ │ │ │ └── usage.mdx │ │ │ └── som │ │ │ ├── configuration.mdx │ │ │ └── index.mdx │ │ ├── meta.json │ │ ├── quickstart-cli.mdx │ │ ├── quickstart-devs.mdx │ │ └── telemetry.mdx │ ├── next.config.mjs │ ├── package-lock.json │ ├── package.json │ ├── pnpm-lock.yaml │ ├── postcss.config.mjs │ ├── public │ │ └── img │ │ ├── agent_gradio_ui.png │ │ ├── agent.png │ │ ├── cli.png │ │ ├── computer.png │ │ ├── som_box_threshold.png │ │ └── som_iou_threshold.png │ ├── README.md │ ├── source.config.ts │ ├── src │ │ ├── app │ │ │ ├── (home) │ │ │ │ ├── [[...slug]] │ │ │ │ │ └── page.tsx │ │ │ │ └── layout.tsx │ │ │ ├── api │ │ │ │ └── search │ │ │ │ └── route.ts │ │ │ ├── favicon.ico │ │ │ ├── global.css │ │ │ ├── layout.config.tsx │ │ │ ├── layout.tsx │ │ │ ├── llms.mdx │ │ │ │ └── [[...slug]] │ │ │ │ └── route.ts │ │ │ └── llms.txt │ │ │ └── route.ts │ │ ├── assets │ │ │ ├── discord-black.svg │ │ │ ├── discord-white.svg │ │ │ ├── logo-black.svg │ │ │ └── logo-white.svg │ │ ├── components │ │ │ ├── iou.tsx │ │ │ └── mermaid.tsx │ │ ├── lib │ │ │ ├── llms.ts │ │ │ └── source.ts │ │ └── mdx-components.tsx │ └── tsconfig.json ├── examples │ ├── agent_examples.py │ ├── agent_ui_examples.py │ ├── computer_examples_windows.py │ ├── computer_examples.py │ ├── computer_ui_examples.py │ ├── computer-example-ts │ │ ├── .env.example │ │ ├── .gitignore │ │ ├── .prettierrc │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── README.md │ │ ├── src │ │ │ ├── helpers.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── docker_examples.py │ ├── evals │ │ ├── hud_eval_examples.py │ │ └── wikipedia_most_linked.txt │ ├── pylume_examples.py │ ├── sandboxed_functions_examples.py │ ├── som_examples.py │ ├── utils.py │ └── winsandbox_example.py ├── img │ ├── agent_gradio_ui.png │ ├── agent.png │ ├── cli.png │ ├── computer.png │ ├── logo_black.png │ └── logo_white.png ├── libs │ ├── kasm │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── README.md │ │ └── src │ │ └── ubuntu │ │ └── install │ │ └── firefox │ │ ├── custom_startup.sh │ │ ├── firefox.desktop │ │ └── install_firefox.sh │ ├── lume │ │ ├── .cursorignore │ │ ├── CONTRIBUTING.md │ │ ├── Development.md │ │ ├── img │ │ │ └── cli.png │ │ ├── Package.resolved │ │ ├── Package.swift │ │ ├── README.md │ │ ├── resources │ │ │ └── lume.entitlements │ │ ├── scripts │ │ │ ├── build │ │ │ │ ├── build-debug.sh │ │ │ │ ├── build-release-notarized.sh │ │ │ │ └── build-release.sh │ │ │ └── install.sh │ │ ├── src │ │ │ ├── Commands │ │ │ │ ├── Clone.swift │ │ │ │ ├── Config.swift │ │ │ │ ├── Create.swift │ │ │ │ ├── Delete.swift │ │ │ │ ├── Get.swift │ │ │ │ ├── Images.swift │ │ │ │ ├── IPSW.swift │ │ │ │ ├── List.swift │ │ │ │ ├── Logs.swift │ │ │ │ ├── Options │ │ │ │ │ └── FormatOption.swift │ │ │ │ ├── Prune.swift │ │ │ │ ├── Pull.swift │ │ │ │ ├── Push.swift │ │ │ │ ├── Run.swift │ │ │ │ ├── Serve.swift │ │ │ │ ├── Set.swift │ │ │ │ └── Stop.swift │ │ │ ├── ContainerRegistry │ │ │ │ ├── ImageContainerRegistry.swift │ │ │ │ ├── ImageList.swift │ │ │ │ └── ImagesPrinter.swift │ │ │ ├── Errors │ │ │ │ └── Errors.swift │ │ │ ├── FileSystem │ │ │ │ ├── Home.swift │ │ │ │ ├── Settings.swift │ │ │ │ ├── VMConfig.swift │ │ │ │ ├── VMDirectory.swift │ │ │ │ └── VMLocation.swift │ │ │ ├── LumeController.swift │ │ │ ├── Main.swift │ │ │ ├── Server │ │ │ │ ├── Handlers.swift │ │ │ │ ├── HTTP.swift │ │ │ │ ├── Requests.swift │ │ │ │ ├── Responses.swift │ │ │ │ └── Server.swift │ │ │ ├── Utils │ │ │ │ ├── CommandRegistry.swift │ │ │ │ ├── CommandUtils.swift │ │ │ │ ├── Logger.swift │ │ │ │ ├── NetworkUtils.swift │ │ │ │ ├── Path.swift │ │ │ │ ├── ProcessRunner.swift │ │ │ │ ├── ProgressLogger.swift │ │ │ │ ├── String.swift │ │ │ │ └── Utils.swift │ │ │ ├── Virtualization │ │ │ │ ├── DarwinImageLoader.swift │ │ │ │ ├── DHCPLeaseParser.swift │ │ │ │ ├── ImageLoaderFactory.swift │ │ │ │ └── VMVirtualizationService.swift │ │ │ ├── VM │ │ │ │ ├── DarwinVM.swift │ │ │ │ ├── LinuxVM.swift │ │ │ │ ├── VM.swift │ │ │ │ ├── VMDetails.swift │ │ │ │ ├── VMDetailsPrinter.swift │ │ │ │ ├── VMDisplayResolution.swift │ │ │ │ └── VMFactory.swift │ │ │ └── VNC │ │ │ ├── PassphraseGenerator.swift │ │ │ └── VNCService.swift │ │ └── tests │ │ ├── Mocks │ │ │ ├── MockVM.swift │ │ │ ├── MockVMVirtualizationService.swift │ │ │ └── MockVNCService.swift │ │ ├── VM │ │ │ └── VMDetailsPrinterTests.swift │ │ ├── VMTests.swift │ │ ├── VMVirtualizationServiceTests.swift │ │ └── VNCServiceTests.swift │ ├── lumier │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── README.md │ │ └── src │ │ ├── bin │ │ │ └── entry.sh │ │ ├── config │ │ │ └── constants.sh │ │ ├── hooks │ │ │ └── on-logon.sh │ │ └── lib │ │ ├── utils.sh │ │ └── vm.sh │ ├── python │ │ ├── agent │ │ │ ├── agent │ │ │ │ ├── __init__.py │ │ │ │ ├── __main__.py │ │ │ │ ├── adapters │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── huggingfacelocal_adapter.py │ │ │ │ │ ├── human_adapter.py │ │ │ │ │ ├── mlxvlm_adapter.py │ │ │ │ │ └── models │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── generic.py │ │ │ │ │ ├── internvl.py │ │ │ │ │ ├── opencua.py │ │ │ │ │ └── qwen2_5_vl.py │ │ │ │ ├── agent.py │ │ │ │ ├── callbacks │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── budget_manager.py │ │ │ │ │ ├── image_retention.py │ │ │ │ │ ├── logging.py │ │ │ │ │ ├── operator_validator.py │ │ │ │ │ ├── pii_anonymization.py │ │ │ │ │ ├── prompt_instructions.py │ │ │ │ │ ├── telemetry.py │ │ │ │ │ └── trajectory_saver.py │ │ │ │ ├── cli.py │ │ │ │ ├── computers │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── cua.py │ │ │ │ │ └── custom.py │ │ │ │ ├── decorators.py │ │ │ │ ├── human_tool │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __main__.py │ │ │ │ │ ├── server.py │ │ │ │ │ └── ui.py │ │ │ │ ├── integrations │ │ │ │ │ └── hud │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── agent.py │ │ │ │ │ └── proxy.py │ │ │ │ ├── loops │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── anthropic.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── composed_grounded.py │ │ │ │ │ ├── glm45v.py │ │ │ │ │ ├── gta1.py │ │ │ │ │ ├── holo.py │ │ │ │ │ ├── internvl.py │ │ │ │ │ ├── model_types.csv │ │ │ │ │ ├── moondream3.py │ │ │ │ │ ├── omniparser.py │ │ │ │ │ ├── openai.py │ │ │ │ │ ├── opencua.py │ │ │ │ │ └── uitars.py │ │ │ │ ├── proxy │ │ │ │ │ ├── examples.py │ │ │ │ │ └── handlers.py │ │ │ │ ├── responses.py │ │ │ │ ├── types.py │ │ │ │ └── ui │ │ │ │ ├── __init__.py │ │ │ │ ├── __main__.py │ │ │ │ └── gradio │ │ │ │ ├── __init__.py │ │ │ │ ├── app.py │ │ │ │ └── ui_components.py │ │ │ ├── benchmarks │ │ │ │ ├── .gitignore │ │ │ │ ├── contrib.md │ │ │ │ ├── interactive.py │ │ │ │ ├── models │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ └── gta1.py │ │ │ │ ├── README.md │ │ │ │ ├── ss-pro.py │ │ │ │ ├── ss-v2.py │ │ │ │ └── utils.py │ │ │ ├── example.py │ │ │ ├── pyproject.toml │ │ │ └── README.md │ │ ├── computer │ │ │ ├── computer │ │ │ │ ├── __init__.py │ │ │ │ ├── computer.py │ │ │ │ ├── diorama_computer.py │ │ │ │ ├── helpers.py │ │ │ │ ├── interface │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── factory.py │ │ │ │ │ ├── generic.py │ │ │ │ │ ├── linux.py │ │ │ │ │ ├── macos.py │ │ │ │ │ ├── models.py │ │ │ │ │ └── windows.py │ │ │ │ ├── logger.py │ │ │ │ ├── models.py │ │ │ │ ├── providers │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── cloud │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── provider.py │ │ │ │ │ ├── docker │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── provider.py │ │ │ │ │ ├── factory.py │ │ │ │ │ ├── lume │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── provider.py │ │ │ │ │ ├── lume_api.py │ │ │ │ │ ├── lumier │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── provider.py │ │ │ │ │ └── winsandbox │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── provider.py │ │ │ │ │ └── setup_script.ps1 │ │ │ │ ├── ui │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __main__.py │ │ │ │ │ └── gradio │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── app.py │ │ │ │ └── utils.py │ │ │ ├── poetry.toml │ │ │ ├── pyproject.toml │ │ │ └── README.md │ │ ├── computer-server │ │ │ ├── computer_server │ │ │ │ ├── __init__.py │ │ │ │ ├── __main__.py │ │ │ │ ├── cli.py │ │ │ │ ├── diorama │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── diorama_computer.py │ │ │ │ │ ├── diorama.py │ │ │ │ │ ├── draw.py │ │ │ │ │ ├── macos.py │ │ │ │ │ └── safezone.py │ │ │ │ ├── handlers │ │ │ │ │ ├── base.py │ │ │ │ │ ├── factory.py │ │ │ │ │ ├── generic.py │ │ │ │ │ ├── linux.py │ │ │ │ │ ├── macos.py │ │ │ │ │ └── windows.py │ │ │ │ ├── main.py │ │ │ │ ├── server.py │ │ │ │ └── watchdog.py │ │ │ ├── examples │ │ │ │ ├── __init__.py │ │ │ │ └── usage_example.py │ │ │ ├── pyproject.toml │ │ │ ├── README.md │ │ │ ├── run_server.py │ │ │ └── test_connection.py │ │ ├── core │ │ │ ├── core │ │ │ │ ├── __init__.py │ │ │ │ └── telemetry │ │ │ │ ├── __init__.py │ │ │ │ └── posthog.py │ │ │ ├── poetry.toml │ │ │ ├── pyproject.toml │ │ │ └── README.md │ │ ├── mcp-server │ │ │ ├── mcp_server │ │ │ │ ├── __init__.py │ │ │ │ ├── __main__.py │ │ │ │ └── server.py │ │ │ ├── pyproject.toml │ │ │ ├── README.md │ │ │ └── scripts │ │ │ ├── install_mcp_server.sh │ │ │ └── start_mcp_server.sh │ │ ├── pylume │ │ │ ├── __init__.py │ │ │ ├── pylume │ │ │ │ ├── __init__.py │ │ │ │ ├── client.py │ │ │ │ ├── exceptions.py │ │ │ │ ├── lume │ │ │ │ ├── models.py │ │ │ │ ├── pylume.py │ │ │ │ └── server.py │ │ │ ├── pyproject.toml │ │ │ └── README.md │ │ └── som │ │ ├── LICENSE │ │ ├── poetry.toml │ │ ├── pyproject.toml │ │ ├── README.md │ │ ├── som │ │ │ ├── __init__.py │ │ │ ├── detect.py │ │ │ ├── detection.py │ │ │ ├── models.py │ │ │ ├── ocr.py │ │ │ ├── util │ │ │ │ └── utils.py │ │ │ └── visualization.py │ │ └── tests │ │ └── test_omniparser.py │ ├── typescript │ │ ├── .gitignore │ │ ├── .nvmrc │ │ ├── agent │ │ │ ├── examples │ │ │ │ ├── playground-example.html │ │ │ │ └── README.md │ │ │ ├── package.json │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── client.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── tests │ │ │ │ └── client.test.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsdown.config.ts │ │ │ └── vitest.config.ts │ │ ├── biome.json │ │ ├── computer │ │ │ ├── .editorconfig │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── package.json │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── computer │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── providers │ │ │ │ │ │ ├── base.ts │ │ │ │ │ │ ├── cloud.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface │ │ │ │ │ ├── base.ts │ │ │ │ │ ├── factory.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── linux.ts │ │ │ │ │ ├── macos.ts │ │ │ │ │ └── windows.ts │ │ │ │ └── types.ts │ │ │ ├── tests │ │ │ │ ├── computer │ │ │ │ │ └── cloud.test.ts │ │ │ │ ├── interface │ │ │ │ │ ├── factory.test.ts │ │ │ │ │ ├── index.test.ts │ │ │ │ │ ├── linux.test.ts │ │ │ │ │ ├── macos.test.ts │ │ │ │ │ └── windows.test.ts │ │ │ │ └── setup.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsdown.config.ts │ │ │ └── vitest.config.ts │ │ ├── core │ │ │ ├── .editorconfig │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── package.json │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── index.ts │ │ │ │ └── telemetry │ │ │ │ ├── clients │ │ │ │ │ ├── index.ts │ │ │ │ │ └── posthog.ts │ │ │ │ └── index.ts │ │ │ ├── tests │ │ │ │ └── telemetry.test.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsdown.config.ts │ │ │ └── vitest.config.ts │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── pnpm-workspace.yaml │ │ └── README.md │ └── xfce │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ └── src │ ├── scripts │ │ ├── resize-display.sh │ │ ├── start-computer-server.sh │ │ ├── start-novnc.sh │ │ ├── start-vnc.sh │ │ └── xstartup.sh │ ├── supervisor │ │ └── supervisord.conf │ └── xfce-config │ ├── helpers.rc │ ├── xfce4-power-manager.xml │ └── xfce4-session.xml ├── LICENSE.md ├── notebooks │ ├── agent_nb.ipynb │ ├── blog │ │ ├── build-your-own-operator-on-macos-1.ipynb │ │ └── build-your-own-operator-on-macos-2.ipynb │ ├── composite_agents_docker_nb.ipynb │ ├── computer_nb.ipynb │ ├── computer_server_nb.ipynb │ ├── customizing_computeragent.ipynb │ ├── eval_osworld.ipynb │ ├── ollama_nb.ipynb │ ├── pylume_nb.ipynb │ ├── README.md │ ├── sota_hackathon_cloud.ipynb │ └── sota_hackathon.ipynb ├── pdm.lock ├── pyproject.toml ├── pyrightconfig.json ├── README.md ├── samples │ └── community │ ├── global-online │ │ └── README.md │ └── hack-the-north │ └── README.md ├── scripts │ ├── build-uv.sh │ ├── build.ps1 │ ├── build.sh │ ├── cleanup.sh │ ├── playground-docker.sh │ ├── playground.sh │ └── run-docker-dev.sh └── tests ├── pytest.ini ├── shell_cmd.py ├── test_files.py ├── test_shell_bash.py ├── test_telemetry.py ├── test_venv.py └── test_watchdog.py ``` # Files -------------------------------------------------------------------------------- /libs/typescript/.nvmrc: -------------------------------------------------------------------------------- ``` 1 | v24.2.0 2 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/.gitattributes: -------------------------------------------------------------------------------- ``` 1 | * text=auto eol=lf 2 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/.gitattributes: -------------------------------------------------------------------------------- ``` 1 | * text=auto eol=lf 2 | ``` -------------------------------------------------------------------------------- /examples/computer-example-ts/.gitignore: -------------------------------------------------------------------------------- ``` 1 | node_modules 2 | .DS_Store 3 | .env ``` -------------------------------------------------------------------------------- /libs/xfce/.gitignore: -------------------------------------------------------------------------------- ``` 1 | storage/ 2 | shared/ 3 | *.log 4 | .DS_Store 5 | ``` -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- ``` 1 | * text=auto 2 | *.sh text eol=lf ``` -------------------------------------------------------------------------------- /libs/xfce/.dockerignore: -------------------------------------------------------------------------------- ``` 1 | README.md 2 | .git 3 | .gitignore 4 | *.md 5 | LICENSE 6 | ``` -------------------------------------------------------------------------------- /libs/python/agent/benchmarks/.gitignore: -------------------------------------------------------------------------------- ``` 1 | output/ 2 | interactive_output/ 3 | *_results.md ``` -------------------------------------------------------------------------------- /libs/typescript/.gitignore: -------------------------------------------------------------------------------- ``` 1 | node_modules 2 | 3 | *.log 4 | .DS_Store 5 | .eslintcache 6 | ``` -------------------------------------------------------------------------------- /examples/computer-example-ts/.env.example: -------------------------------------------------------------------------------- ``` 1 | OPENAI_API_KEY= 2 | CUA_API_KEY= 3 | CUA_CONTAINER_NAME= ``` -------------------------------------------------------------------------------- /libs/typescript/computer/.gitignore: -------------------------------------------------------------------------------- ``` 1 | node_modules 2 | dist 3 | 4 | *.log 5 | .DS_Store 6 | .eslintcache 7 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/.gitignore: -------------------------------------------------------------------------------- ``` 1 | node_modules 2 | dist 3 | 4 | *.log 5 | .DS_Store 6 | .eslintcache 7 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/.editorconfig: -------------------------------------------------------------------------------- ``` 1 | root = true 2 | 3 | [*] 4 | indent_size = 2 5 | end_of_line = lf 6 | insert_final_newline = true 7 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/.editorconfig: -------------------------------------------------------------------------------- ``` 1 | root = true 2 | 3 | [*] 4 | indent_size = 2 5 | end_of_line = lf 6 | insert_final_newline = true 7 | ``` -------------------------------------------------------------------------------- /examples/computer-example-ts/.prettierrc: -------------------------------------------------------------------------------- ``` 1 | { 2 | "useTabs": false, 3 | "semi": true, 4 | "singleQuote": true, 5 | "trailingComma": "es5", 6 | "bracketSpacing": true 7 | } ``` -------------------------------------------------------------------------------- /docs/.prettierrc: -------------------------------------------------------------------------------- ``` 1 | { 2 | "useTabs": false, 3 | "semi": true, 4 | "singleQuote": true, 5 | "trailingComma": "es5", 6 | "bracketSpacing": true, 7 | "jsxBracketSameLine": true 8 | } ``` -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- ``` 1 | # deps 2 | /node_modules 3 | 4 | # generated content 5 | .contentlayer 6 | .content-collections 7 | .source 8 | 9 | # test & build 10 | /coverage 11 | /.next/ 12 | /out/ 13 | /build 14 | *.tsbuildinfo 15 | 16 | # misc 17 | .DS_Store 18 | *.pem 19 | /.pnp 20 | .pnp.js 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | # others 26 | .env*.local 27 | .vercel 28 | next-env.d.ts ``` -------------------------------------------------------------------------------- /libs/lumier/.dockerignore: -------------------------------------------------------------------------------- ``` 1 | # Ignore macOS system files and trash 2 | .DS_Store 3 | .Trashes 4 | **/.Trashes 5 | **/.* 6 | 7 | # Ignore Python cache 8 | __pycache__/ 9 | *.pyc 10 | *.pyo 11 | 12 | # Ignore virtual environments 13 | .venv/ 14 | venv/ 15 | 16 | # Ignore editor/project files 17 | .vscode/ 18 | .idea/ 19 | *.swp 20 | 21 | # Ignore test artifacts 22 | test-results/ 23 | 24 | # Ignore anything else you don't want in the Docker build context 25 | ./examples ``` -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- ``` 1 | # Version control 2 | .git 3 | .github 4 | .gitignore 5 | 6 | # Environment and cache 7 | .venv 8 | .env 9 | .env.local 10 | __pycache__ 11 | *.pyc 12 | *.pyo 13 | *.pyd 14 | .Python 15 | .pytest_cache 16 | .pdm-build 17 | 18 | # Distribution / packaging 19 | dist 20 | build 21 | *.egg-info 22 | 23 | # Development 24 | .vscode 25 | .idea 26 | *.swp 27 | *.swo 28 | 29 | # Docs 30 | docs/site 31 | 32 | # Notebooks 33 | notebooks/.ipynb_checkpoints 34 | 35 | # Docker 36 | Dockerfile 37 | .dockerignore ``` -------------------------------------------------------------------------------- /libs/lume/.cursorignore: -------------------------------------------------------------------------------- ``` 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | !libs/lume/scripts/build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | cover/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | .pybuilder/ 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | .pdm.toml 87 | .pdm-python 88 | .pdm-build/ 89 | 90 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 91 | __pypackages__/ 92 | 93 | # Celery stuff 94 | celerybeat-schedule 95 | celerybeat.pid 96 | 97 | # SageMath parsed files 98 | *.sage.py 99 | 100 | # Environments 101 | .env 102 | .venv 103 | env/ 104 | venv/ 105 | ENV/ 106 | env.bak/ 107 | venv.bak/ 108 | 109 | # Spyder project settings 110 | .spyderproject 111 | .spyproject 112 | 113 | # Rope project settings 114 | .ropeproject 115 | 116 | # mkdocs documentation 117 | /site 118 | 119 | # mypy 120 | .mypy_cache/ 121 | .dmypy.json 122 | dmypy.json 123 | 124 | # Scripts 125 | server/scripts/ 126 | 127 | # Pyre type checker 128 | .pyre/ 129 | 130 | # pytype static type analyzer 131 | .pytype/ 132 | 133 | # Cython debug symbols 134 | cython_debug/ 135 | 136 | # Ruff stuff: 137 | .ruff_cache/ 138 | 139 | # PyPI configuration file 140 | .pypirc 141 | 142 | # Conda 143 | .conda/ 144 | 145 | # Local environment 146 | .env.local 147 | 148 | # macOS DS_Store 149 | .DS_Store 150 | 151 | weights/ 152 | weights/icon_detect/ 153 | weights/icon_detect/model.pt 154 | weights/icon_detect/model.pt.zip 155 | weights/icon_detect/model.pt.zip.part* 156 | 157 | libs/omniparser/weights/icon_detect/model.pt 158 | 159 | # Example test data and output 160 | examples/test_data/ 161 | examples/output/ 162 | 163 | /screenshots/ 164 | 165 | /experiments/ 166 | 167 | /logs/ 168 | 169 | # Xcode 170 | # 171 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 172 | 173 | ## User settings 174 | xcuserdata/ 175 | 176 | ## Obj-C/Swift specific 177 | *.hmap 178 | 179 | ## App packaging 180 | *.ipa 181 | *.dSYM.zip 182 | *.dSYM 183 | 184 | ## Playgrounds 185 | timeline.xctimeline 186 | playground.xcworkspace 187 | 188 | # Swift Package Manager 189 | # 190 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 191 | # Packages/ 192 | # Package.pins 193 | # Package.resolved 194 | # *.xcodeproj 195 | # 196 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 197 | # hence it is not needed unless you have added a package configuration file to your project 198 | .swiftpm/ 199 | .build/ 200 | 201 | # CocoaPods 202 | # 203 | # We recommend against adding the Pods directory to your .gitignore. However 204 | # you should judge for yourself, the pros and cons are mentioned at: 205 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 206 | # 207 | # Pods/ 208 | # 209 | # Add this line if you want to avoid checking in source code from the Xcode workspace 210 | # *.xcworkspace 211 | 212 | # Carthage 213 | # 214 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 215 | # Carthage/Checkouts 216 | Carthage/Build/ 217 | 218 | # fastlane 219 | # 220 | # It is recommended to not store the screenshots in the git repo. 221 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 222 | # For more information about the recommended setup visit: 223 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 224 | fastlane/report.xml 225 | fastlane/Preview.html 226 | fastlane/screenshots/**/*.png 227 | fastlane/test_output 228 | 229 | # Ignore folder 230 | ignore 231 | 232 | # .release 233 | .release/ ``` -------------------------------------------------------------------------------- /.cursorignore: -------------------------------------------------------------------------------- ``` 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | !libs/lume/scripts/build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | cover/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | .pybuilder/ 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | .pdm.toml 87 | .pdm-python 88 | .pdm-build/ 89 | 90 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 91 | __pypackages__/ 92 | 93 | # Celery stuff 94 | celerybeat-schedule 95 | celerybeat.pid 96 | 97 | # SageMath parsed files 98 | *.sage.py 99 | 100 | # Environments 101 | .env 102 | .venv 103 | env/ 104 | venv/ 105 | ENV/ 106 | env.bak/ 107 | venv.bak/ 108 | 109 | # Spyder project settings 110 | .spyderproject 111 | .spyproject 112 | 113 | # Rope project settings 114 | .ropeproject 115 | 116 | # mkdocs documentation 117 | /site 118 | 119 | # mypy 120 | .mypy_cache/ 121 | .dmypy.json 122 | dmypy.json 123 | 124 | # Scripts 125 | server/scripts/ 126 | 127 | # Pyre type checker 128 | .pyre/ 129 | 130 | # pytype static type analyzer 131 | .pytype/ 132 | 133 | # Cython debug symbols 134 | cython_debug/ 135 | 136 | # Ruff stuff: 137 | .ruff_cache/ 138 | 139 | # PyPI configuration file 140 | .pypirc 141 | 142 | # Conda 143 | .conda/ 144 | 145 | # Local environment 146 | .env.local 147 | 148 | # macOS DS_Store 149 | .DS_Store 150 | 151 | weights/ 152 | weights/icon_detect/ 153 | weights/icon_detect/model.pt 154 | weights/icon_detect/model.pt.zip 155 | weights/icon_detect/model.pt.zip.part* 156 | 157 | libs/python/omniparser/weights/icon_detect/model.pt 158 | 159 | # Example test data and output 160 | examples/test_data/ 161 | examples/output/ 162 | 163 | /screenshots/ 164 | 165 | /experiments/ 166 | 167 | /logs/ 168 | 169 | # Xcode 170 | # 171 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 172 | 173 | ## User settings 174 | xcuserdata/ 175 | 176 | ## Obj-C/Swift specific 177 | *.hmap 178 | 179 | ## App packaging 180 | *.ipa 181 | *.dSYM.zip 182 | *.dSYM 183 | 184 | ## Playgrounds 185 | timeline.xctimeline 186 | playground.xcworkspace 187 | 188 | # Swift Package Manager 189 | # 190 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 191 | # Packages/ 192 | # Package.pins 193 | # Package.resolved 194 | # *.xcodeproj 195 | # 196 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 197 | # hence it is not needed unless you have added a package configuration file to your project 198 | .swiftpm/ 199 | .build/ 200 | 201 | # CocoaPods 202 | # 203 | # We recommend against adding the Pods directory to your .gitignore. However 204 | # you should judge for yourself, the pros and cons are mentioned at: 205 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 206 | # 207 | # Pods/ 208 | # 209 | # Add this line if you want to avoid checking in source code from the Xcode workspace 210 | # *.xcworkspace 211 | 212 | # Carthage 213 | # 214 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 215 | # Carthage/Checkouts 216 | Carthage/Build/ 217 | 218 | # fastlane 219 | # 220 | # It is recommended to not store the screenshots in the git repo. 221 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 222 | # For more information about the recommended setup visit: 223 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 224 | fastlane/report.xml 225 | fastlane/Preview.html 226 | fastlane/screenshots/**/*.png 227 | fastlane/test_output 228 | 229 | # Ignore folder 230 | ignore 231 | 232 | # .release 233 | .release/ ``` -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- ``` 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | node_modules/* 10 | */node_modules 11 | **/node_modules 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | !libs/lume/scripts/build/ 17 | develop-eggs/ 18 | dist/ 19 | downloads/ 20 | eggs/ 21 | .eggs/ 22 | lib/* 23 | !libs/lumier/src/lib/ 24 | lib64/ 25 | parts/ 26 | sdist/ 27 | var/ 28 | wheels/ 29 | share/python-wheels/ 30 | *.egg-info/ 31 | .installed.cfg 32 | *.egg 33 | MANIFEST 34 | 35 | # PyInstaller 36 | # Usually these files are written by a python script from a template 37 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 38 | *.manifest 39 | *.spec 40 | 41 | # Installer logs 42 | pip-log.txt 43 | pip-delete-this-directory.txt 44 | 45 | # Unit test / coverage reports 46 | htmlcov/ 47 | .tox/ 48 | .nox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *.cover 55 | *.py,cover 56 | .hypothesis/ 57 | .pytest_cache/ 58 | cover/ 59 | 60 | # Translations 61 | *.mo 62 | *.pot 63 | 64 | # Django stuff: 65 | *.log 66 | local_settings.py 67 | db.sqlite3 68 | db.sqlite3-journal 69 | 70 | # Flask stuff: 71 | instance/ 72 | .webassets-cache 73 | 74 | # Scrapy stuff: 75 | .scrapy 76 | 77 | # Sphinx documentation 78 | docs/_build/ 79 | 80 | # PyBuilder 81 | .pybuilder/ 82 | target/ 83 | 84 | # Jupyter Notebook 85 | .ipynb_checkpoints 86 | 87 | # IPython 88 | profile_default/ 89 | ipython_config.py 90 | 91 | .pdm.toml 92 | .pdm-python 93 | .pdm-build/ 94 | 95 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 96 | __pypackages__/ 97 | 98 | # Celery stuff 99 | celerybeat-schedule 100 | celerybeat.pid 101 | 102 | # SageMath parsed files 103 | *.sage.py 104 | 105 | # Environments 106 | .env 107 | .venv 108 | env/ 109 | venv/ 110 | ENV/ 111 | env.bak/ 112 | venv.bak/ 113 | 114 | # Spyder project settings 115 | .spyderproject 116 | .spyproject 117 | 118 | # Rope project settings 119 | .ropeproject 120 | 121 | # mkdocs documentation 122 | /site 123 | 124 | # mypy 125 | .mypy_cache/ 126 | .dmypy.json 127 | dmypy.json 128 | 129 | # Scripts 130 | server/scripts/ 131 | 132 | # Pyre type checker 133 | .pyre/ 134 | 135 | # pytype static type analyzer 136 | .pytype/ 137 | 138 | # Cython debug symbols 139 | cython_debug/ 140 | 141 | # Ruff stuff: 142 | .ruff_cache/ 143 | 144 | # PyPI configuration file 145 | .pypirc 146 | 147 | # Conda 148 | .conda/ 149 | 150 | # Local environment 151 | .env.local 152 | 153 | # macOS DS_Store 154 | .DS_Store 155 | 156 | weights/ 157 | weights/icon_detect/ 158 | weights/icon_detect/model.pt 159 | weights/icon_detect/model.pt.zip 160 | weights/icon_detect/model.pt.zip.part* 161 | 162 | libs/python/omniparser/weights/icon_detect/model.pt 163 | 164 | # Example test data and output 165 | examples/test_data/ 166 | examples/output/ 167 | 168 | /screenshots/ 169 | 170 | /experiments/ 171 | 172 | /logs/ 173 | 174 | # Xcode 175 | # 176 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 177 | 178 | ## User settings 179 | xcuserdata/ 180 | 181 | ## Obj-C/Swift specific 182 | *.hmap 183 | 184 | ## App packaging 185 | *.ipa 186 | *.dSYM.zip 187 | *.dSYM 188 | 189 | ## Playgrounds 190 | timeline.xctimeline 191 | playground.xcworkspace 192 | 193 | # Swift Package Manager 194 | # 195 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 196 | # Packages/ 197 | # Package.pins 198 | # Package.resolved 199 | # *.xcodeproj 200 | # 201 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 202 | # hence it is not needed unless you have added a package configuration file to your project 203 | .swiftpm/ 204 | .build/ 205 | 206 | # CocoaPods 207 | # 208 | # We recommend against adding the Pods directory to your .gitignore. However 209 | # you should judge for yourself, the pros and cons are mentioned at: 210 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 211 | # 212 | # Pods/ 213 | # 214 | # Add this line if you want to avoid checking in source code from the Xcode workspace 215 | # *.xcworkspace 216 | 217 | # Carthage 218 | # 219 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 220 | # Carthage/Checkouts 221 | Carthage/Build/ 222 | 223 | # fastlane 224 | # 225 | # It is recommended to not store the screenshots in the git repo. 226 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 227 | # For more information about the recommended setup visit: 228 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 229 | fastlane/report.xml 230 | fastlane/Preview.html 231 | fastlane/screenshots/**/*.png 232 | fastlane/test_output 233 | 234 | # Ignore folder 235 | ignore 236 | 237 | # .release 238 | .release/ 239 | 240 | # Shared folder 241 | shared 242 | 243 | # Trajectories 244 | trajectories/ 245 | 246 | # Installation ID Storage 247 | .storage/ 248 | 249 | # Gradio settings 250 | .gradio_settings.json 251 | 252 | # Lumier Storage 253 | storage/ 254 | 255 | # Trashes 256 | .Trashes 257 | .Trash-1000/ 258 | 259 | post-provision ``` -------------------------------------------------------------------------------- /.all-contributorsrc: -------------------------------------------------------------------------------- ``` 1 | { 2 | "projectName": "cua", 3 | "projectOwner": "trycua", 4 | "files": [ 5 | "README.md" 6 | ], 7 | "commitType": "docs", 8 | "commitConvention": "angular", 9 | "contributorsPerLine": 7, 10 | "contributors": [ 11 | { 12 | "login": "f-trycua", 13 | "name": "f-trycua", 14 | "avatar_url": "https://avatars.githubusercontent.com/u/195596869?v=4", 15 | "profile": "https://github.com/f-trycua", 16 | "contributions": [ 17 | "code" 18 | ] 19 | }, 20 | { 21 | "login": "pepicrft", 22 | "name": "Pedro Piñera Buendía", 23 | "avatar_url": "https://avatars.githubusercontent.com/u/663605?v=4", 24 | "profile": "http://pepicrft.me", 25 | "contributions": [ 26 | "code" 27 | ] 28 | }, 29 | { 30 | "login": "aktech", 31 | "name": "Amit Kumar", 32 | "avatar_url": "https://avatars.githubusercontent.com/u/5647941?v=4", 33 | "profile": "https://iamit.in", 34 | "contributions": [ 35 | "code" 36 | ] 37 | }, 38 | { 39 | "login": "jellydn", 40 | "name": "Dung Duc Huynh (Kaka)", 41 | "avatar_url": "https://avatars.githubusercontent.com/u/870029?v=4", 42 | "profile": "https://productsway.com/", 43 | "contributions": [ 44 | "code" 45 | ] 46 | }, 47 | { 48 | "login": "ShrootBuck", 49 | "name": "Zayd Krunz", 50 | "avatar_url": "https://avatars.githubusercontent.com/u/70227235?v=4", 51 | "profile": "http://zaydkrunz.com", 52 | "contributions": [ 53 | "code" 54 | ] 55 | }, 56 | { 57 | "login": "PrashantRaj18198", 58 | "name": "Prashant Raj", 59 | "avatar_url": "https://avatars.githubusercontent.com/u/23168997?v=4", 60 | "profile": "https://github.com/PrashantRaj18198", 61 | "contributions": [ 62 | "code" 63 | ] 64 | }, 65 | { 66 | "login": "Leland-Takamine", 67 | "name": "Leland Takamine", 68 | "avatar_url": "https://avatars.githubusercontent.com/u/847683?v=4", 69 | "profile": "https://www.mobile.dev", 70 | "contributions": [ 71 | "code" 72 | ] 73 | }, 74 | { 75 | "login": "ddupont808", 76 | "name": "ddupont", 77 | "avatar_url": "https://avatars.githubusercontent.com/u/3820588?v=4", 78 | "profile": "https://github.com/ddupont808", 79 | "contributions": [ 80 | "code" 81 | ] 82 | }, 83 | { 84 | "login": "Lizzard1123", 85 | "name": "Ethan Gutierrez", 86 | "avatar_url": "https://avatars.githubusercontent.com/u/46036335?v=4", 87 | "profile": "https://github.com/Lizzard1123", 88 | "contributions": [ 89 | "code" 90 | ] 91 | }, 92 | { 93 | "login": "RicterZ", 94 | "name": "Ricter Zheng", 95 | "avatar_url": "https://avatars.githubusercontent.com/u/5282759?v=4", 96 | "profile": "https://ricterz.me", 97 | "contributions": [ 98 | "code" 99 | ] 100 | }, 101 | { 102 | "login": "rahulkarajgikar", 103 | "name": "Rahul Karajgikar", 104 | "avatar_url": "https://avatars.githubusercontent.com/u/50844303?v=4", 105 | "profile": "https://www.trytruffle.ai/", 106 | "contributions": [ 107 | "code" 108 | ] 109 | }, 110 | { 111 | "login": "trospix", 112 | "name": "trospix", 113 | "avatar_url": "https://avatars.githubusercontent.com/u/81363696?v=4", 114 | "profile": "https://github.com/trospix", 115 | "contributions": [ 116 | "code" 117 | ] 118 | }, 119 | { 120 | "login": "eltociear", 121 | "name": "Ikko Eltociear Ashimine", 122 | "avatar_url": "https://avatars.githubusercontent.com/u/22633385?v=4", 123 | "profile": "https://wavee.world/invitation/b96d00e6-b802-4a1b-8a66-2e3854a01ffd", 124 | "contributions": [ 125 | "code" 126 | ] 127 | }, 128 | { 129 | "login": "dp221125", 130 | "name": "한석호(MilKyo)", 131 | "avatar_url": "https://avatars.githubusercontent.com/u/10572119?v=4", 132 | "profile": "https://github.com/dp221125", 133 | "contributions": [ 134 | "code" 135 | ] 136 | }, 137 | { 138 | "login": "rahimnathwani", 139 | "name": "Rahim Nathwani", 140 | "avatar_url": "https://avatars.githubusercontent.com/u/891558?v=4", 141 | "profile": "https://www.encona.com/", 142 | "contributions": [ 143 | "code" 144 | ] 145 | }, 146 | { 147 | "login": "mjspeck", 148 | "name": "Matt Speck", 149 | "avatar_url": "https://avatars.githubusercontent.com/u/20689127?v=4", 150 | "profile": "https://mjspeck.github.io/", 151 | "contributions": [ 152 | "code" 153 | ] 154 | }, 155 | { 156 | "login": "FinnBorge", 157 | "name": "FinnBorge", 158 | "avatar_url": "https://avatars.githubusercontent.com/u/9272726?v=4", 159 | "profile": "https://github.com/FinnBorge", 160 | "contributions": [ 161 | "code" 162 | ] 163 | }, 164 | { 165 | "login": "jklapacz", 166 | "name": "Jakub Klapacz", 167 | "avatar_url": "https://avatars.githubusercontent.com/u/5343758?v=4", 168 | "profile": "https://github.com/jklapacz", 169 | "contributions": [ 170 | "code" 171 | ] 172 | }, 173 | { 174 | "login": "evnsnclr", 175 | "name": "Evan smith", 176 | "avatar_url": "https://avatars.githubusercontent.com/u/139897548?v=4", 177 | "profile": "https://github.com/evnsnclr", 178 | "contributions": [ 179 | "code" 180 | ] 181 | } 182 | ] 183 | } 184 | ``` -------------------------------------------------------------------------------- /libs/python/core/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/cua-core/) 15 | </h1> 16 | </div> 17 | 18 | **Cua Core** provides essential shared functionality and utilities used across the Cua ecosystem: 19 | 20 | - Privacy-focused telemetry system for transparent usage analytics 21 | - Common helper functions and utilities used by other Cua packages 22 | - Core infrastructure components shared between modules 23 | 24 | ## Installation 25 | 26 | ```bash 27 | pip install cua-core 28 | ``` ``` -------------------------------------------------------------------------------- /examples/computer-example-ts/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # cua-cloud-openai Example 2 | 3 | This example demonstrates how to control a Cua Cloud Sandbox using the OpenAI `computer-use-preview` model and the `@trycua/computer` TypeScript library. 4 | 5 | ## Overview 6 | 7 | - Connects to a Cua Cloud Sandbox via the `@trycua/computer` library 8 | - Sends screenshots and instructions to OpenAI's computer-use model 9 | - Executes AI-generated actions (clicks, typing, etc.) inside the sandbox 10 | - Designed for Linux sandboxes, but can be adapted for other OS types 11 | 12 | ## Getting Started 13 | 14 | 1. **Install dependencies:** 15 | 16 | ```bash 17 | npm install 18 | ``` 19 | 20 | 2. **Set up environment variables:** 21 | Create a `.env` file with the following variables: 22 | - `OPENAI_API_KEY` — your OpenAI API key 23 | - `CUA_API_KEY` — your Cua Cloud API key 24 | - `CUA_CONTAINER_NAME` — the name of your provisioned sandbox 25 | 26 | 3. **Run the example:** 27 | 28 | ```bash 29 | npx tsx src/index.ts 30 | ``` 31 | 32 | ## Files 33 | 34 | - `src/index.ts` — Main example script 35 | - `src/helpers.ts` — Helper for executing actions on the container 36 | 37 | ## Further Reading 38 | 39 | For a step-by-step tutorial and more detailed explanation, see the accompanying blog post: 40 | 41 | ➡️ [Controlling a Cua Cloud Sandbox with JavaScript](https://placeholder-url-to-blog-post.com) 42 | 43 | _(This link will be updated once the article is published.)_ 44 | 45 | --- 46 | 47 | If you have questions or issues, please open an issue or contact the maintainers. 48 | ``` -------------------------------------------------------------------------------- /notebooks/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # CUA Notebooks 2 | 3 | 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. 4 | 5 | ## Available Notebooks 6 | 7 | ### Core Components 8 | - **`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 9 | - **`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) 10 | - **`pylume_nb.ipynb`** - Quickstart guide for the pylume Python library, which handles VM creation, management, and image operations 11 | - **`computer_server_nb.ipynb`** - Demonstrates how to host and configure the Computer server that powers the Computer API 12 | 13 | ### Evaluation & Benchmarking 14 | - **`eval_osworld.ipynb`** - Shows ComputerAgent integration with HUD for OSWorld benchmarking, supporting both Claude and OpenAI models 15 | 16 | ### Tutorials 17 | - **`blog/`** - Tutorial notebooks from blog posts: 18 | - `build-your-own-operator-on-macos-1.ipynb` - Part 1: Building a CUA operator using OpenAI's computer-use-preview model 19 | - `build-your-own-operator-on-macos-2.ipynb` - Part 2: Using the cua-agent package for more advanced automation 20 | ``` -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # docs 2 | 3 | This is a Next.js application generated with 4 | [Create Fumadocs](https://github.com/fuma-nama/fumadocs). 5 | 6 | Run development server: 7 | 8 | ```bash 9 | npm run dev 10 | # or 11 | pnpm dev 12 | # or 13 | yarn dev 14 | ``` 15 | 16 | Open http://localhost:3000 with your browser to see the result. 17 | 18 | ## Explore 19 | 20 | In the project, you can see: 21 | 22 | - `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content. 23 | - `app/layout.config.tsx`: Shared options for layouts, optional but preferred to keep. 24 | 25 | | Route | Description | 26 | | ------------------------- | ------------------------------------------------------ | 27 | | `app/(home)` | The route group for your landing page and other pages. | 28 | | `app/docs` | The documentation layout and pages. | 29 | | `app/api/search/route.ts` | The Route Handler for search. | 30 | 31 | ### Fumadocs MDX 32 | 33 | A `source.config.ts` config file has been included, you can customise different options like frontmatter schema. 34 | 35 | Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details. 36 | 37 | ## Learn More 38 | 39 | To learn more about Next.js and Fumadocs, take a look at the following 40 | resources: 41 | 42 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js 43 | features and API. 44 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 45 | - [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs 46 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://www.npmjs.com/package/@trycua/core) 15 | </h1> 16 | </div> 17 | 18 | **Cua Core** provides essential shared functionality and utilities used across the Cua ecosystem: 19 | 20 | - Privacy-focused telemetry system for transparent usage analytics 21 | - Common helper functions and utilities used by other Cua packages 22 | - Core infrastructure components shared between modules 23 | 24 | ## Installation 25 | 26 | ```bash 27 | pnpm install @trycua/core 28 | ``` 29 | 30 | ## Development 31 | 32 | Install dependencies: 33 | 34 | ```bash 35 | pnpm install 36 | ``` 37 | 38 | Run the unit tests: 39 | 40 | ```bash 41 | pnpm test 42 | ``` 43 | 44 | Build the library: 45 | 46 | ```bash 47 | pnpm build 48 | ``` 49 | 50 | ## License 51 | 52 | [MIT](./LICENSE) License 2025 [CUA](https://github.com/trycua) 53 | ``` -------------------------------------------------------------------------------- /libs/typescript/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # CUA TypeScript Libraries 2 | 3 | This repository contains TypeScript implementations of the CUA libraries: 4 | 5 | - `@trycua/core`: Core functionality including telemetry and logging 6 | - `@trycua/computer`: Computer interaction SDK for VM management and control 7 | 8 | ## Project Structure 9 | 10 | ```text 11 | libs/typescript/ 12 | ├── computer/ # Computer SDK package 13 | ├── core/ # Core functionality package 14 | ├── package.json # Root package configuration 15 | └── pnpm-workspace.yaml # Workspace configuration 16 | ``` 17 | 18 | ## Prerequisites 19 | 20 | - [Node.js](https://nodejs.org/) (v18 or later) 21 | - [pnpm](https://pnpm.io/) (v10 or later) 22 | 23 | ## Setup and Installation 24 | 25 | 1. Install dependencies for all packages: 26 | 27 | ```bash 28 | pnpm install 29 | ``` 30 | 31 | 1. Build all packages: 32 | 33 | ```bash 34 | pnpm build:all 35 | ``` 36 | 37 | ## Development Workflow 38 | 39 | ### Building Packages 40 | 41 | Build all packages in the correct dependency order: 42 | 43 | ```bash 44 | pnpm build:all 45 | ``` 46 | 47 | Build specific packages: 48 | 49 | ```bash 50 | # Build core package 51 | pnpm --filter @trycua/core build 52 | 53 | # Build computer package 54 | pnpm --filter @trycua/computer build 55 | ``` 56 | 57 | ### Running Tests 58 | 59 | Run tests for all packages: 60 | 61 | ```bash 62 | pnpm test:all 63 | ``` 64 | 65 | Run tests for specific packages: 66 | 67 | ```bash 68 | # Test core package 69 | pnpm --filter @trycua/core test 70 | 71 | # Test computer package 72 | pnpm --filter @trycua/computer test 73 | ``` 74 | 75 | ### Linting 76 | 77 | Lint all packages: 78 | 79 | ```bash 80 | pnpm lint:all 81 | ``` 82 | 83 | Fix linting issues: 84 | 85 | ```bash 86 | pnpm lint:fix:all 87 | ``` 88 | 89 | ## Package Details 90 | 91 | ### @trycua/core 92 | 93 | Core functionality for CUA libraries including: 94 | 95 | - Telemetry with PostHog integration 96 | - Common utilities and types 97 | 98 | ### @trycua/computer 99 | 100 | Computer interaction SDK for managing and controlling virtual machines: 101 | 102 | - VM provider system (Cloud) 103 | - Interface system for OS-specific interactions 104 | - Screenshot, keyboard, and mouse control 105 | - Command execution 106 | 107 | ## Publishing 108 | 109 | Prepare packages for publishing: 110 | 111 | ```bash 112 | pnpm -r build 113 | ``` 114 | 115 | Publish packages: 116 | 117 | ```bash 118 | pnpm -r publish 119 | ``` 120 | ``` -------------------------------------------------------------------------------- /libs/typescript/agent/examples/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # CUA Agent Client Examples 2 | 3 | This directory contains examples demonstrating how to use the `@trycua/agent` client library. 4 | 5 | ## Browser Example 6 | 7 | ### `browser-example.html` 8 | 9 | A simple HTML page that demonstrates using the CUA Agent Client in a browser environment. 10 | 11 | **Features:** 12 | - Connect to HTTP/HTTPS or P2P (peer://) agent proxies 13 | - Send text messages to any supported model 14 | - View responses in real-time 15 | - Health check functionality 16 | - Clear, simple interface with no external dependencies 17 | 18 | **Usage:** 19 | 20 | 1. **Build the library first:** 21 | ```bash 22 | cd ../ 23 | pnpm build 24 | ``` 25 | 26 | 2. **Start a local web server** (required for ES modules): 27 | ```bash 28 | # Option 1: Using Python 29 | python -m http.server 8080 30 | 31 | # Option 2: Using Node.js (if you have http-server installed) 32 | npx http-server -p 8080 33 | 34 | # Option 3: Using any other local server 35 | ``` 36 | 37 | 3. **Open in browser:** 38 | Navigate to `http://localhost:8080/examples/playground-example.html` 39 | 40 | 4. **Configure and test:** 41 | - Enter an agent URL (e.g., `https://localhost:8000` or `peer://some-peer-id`) 42 | - Enter a model name (e.g., `anthropic/claude-3-5-sonnet-20241022`) 43 | - Type a message and click "Send Message" or press Enter 44 | - View the response in the output textarea 45 | 46 | **Supported URLs:** 47 | - **HTTP/HTTPS**: `https://localhost:8000`, `http://my-agent-server.com:8080` 48 | - **Peer-to-Peer**: `peer://computer-agent-proxy`, `peer://any-peer-id` 49 | 50 | **Example Models:** 51 | - `anthropic/claude-3-5-sonnet-20241022` 52 | - `openai/gpt-4` 53 | - `huggingface-local/microsoft/UI-TARS-7B` 54 | 55 | **Note:** Make sure you have a CUA agent proxy server running at the specified URL before testing. 56 | 57 | ## Running Agent Proxy Server 58 | 59 | To test the examples, you'll need a CUA agent proxy server running: 60 | 61 | ```bash 62 | # HTTP server (default port 8000) 63 | python -m agent.proxy.cli 64 | 65 | # P2P server 66 | python -m agent.proxy.cli --mode p2p 67 | 68 | # Both HTTP and P2P 69 | python -m agent.proxy.cli --mode both 70 | ``` 71 | ``` -------------------------------------------------------------------------------- /libs/python/computer-server/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/cua-computer-server/) 15 | </h1> 16 | </div> 17 | 18 | **Computer Server** is the server component for the Computer-Use Interface (CUI) framework powering Cua for interacting with local macOS and Linux sandboxes, PyAutoGUI-compatible, and pluggable with any AI agent systems (Cua, Langchain, CrewAI, AutoGen). 19 | 20 | ## Features 21 | 22 | - WebSocket API for computer-use 23 | - Cross-platform support (macOS, Linux) 24 | - Integration with CUA computer library for screen control, keyboard/mouse automation, and accessibility 25 | 26 | ## Install 27 | 28 | To install the Computer-Use Interface (CUI): 29 | 30 | ```bash 31 | pip install cua-computer-server 32 | ``` 33 | 34 | ## Run 35 | 36 | Refer to this notebook for a step-by-step guide on how to use the Computer-Use Server on the host system or VM: 37 | 38 | - [Computer-Use Server](../../notebooks/computer_server_nb.ipynb) 39 | 40 | ## Docs 41 | 42 | - [Commands](https://trycua.com/docs/libraries/computer-server/Commands) 43 | - [REST-API](https://trycua.com/docs/libraries/computer-server/REST-API) 44 | - [WebSocket-API](https://trycua.com/docs/libraries/computer-server/WebSocket-API) 45 | - [Index](https://trycua.com/docs/libraries/computer-server/index) ``` -------------------------------------------------------------------------------- /libs/python/pylume/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/pylume/) 15 | </h1> 16 | </div> 17 | 18 | 19 | **pylume** is a lightweight Python library based on [lume](https://github.com/trycua/lume) to create, run and manage macOS and Linux virtual machines (VMs) natively on Apple Silicon. 20 | 21 | ```bash 22 | pip install pylume 23 | ``` 24 | 25 | ## Usage 26 | 27 | Please refer to this [Notebook](./samples/nb.ipynb) for a quickstart. More details about the underlying API used by pylume are available [here](https://github.com/trycua/lume/docs/API-Reference.md). 28 | 29 | ## Prebuilt Images 30 | 31 | Pre-built images are available on [ghcr.io/trycua](https://github.com/orgs/trycua/packages). 32 | These images come pre-configured with an SSH server and auto-login enabled. 33 | 34 | ## Contributing 35 | 36 | We welcome and greatly appreciate contributions to lume! Whether you're improving documentation, adding new features, fixing bugs, or adding new VM images, your efforts help make pylume better for everyone. 37 | 38 | Join our [Discord community](https://discord.com/invite/mVnXXpdE85) to discuss ideas or get assistance. 39 | 40 | ## License 41 | 42 | lume is open-sourced under the MIT License - see the [LICENSE](LICENSE) file for details. 43 | 44 | ## Stargazers over time 45 | 46 | [](https://starchart.cc/trycua/pylume) 47 | ``` -------------------------------------------------------------------------------- /libs/python/agent/benchmarks/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Computer Agent Benchmarks 2 | 3 | This directory contains benchmarks designed to test agent providers in the Computer Agent SDK against reference agent implementations. 4 | 5 | ## Overview 6 | 7 | The benchmark system evaluates models on GUI grounding tasks, specifically click prediction accuracy. It supports both: 8 | - **Computer Agent SDK providers** (using model strings like `"huggingface-local/HelloKKMe/GTA1-7B"`) 9 | - **Reference agent implementations** (custom model classes implementing the `ModelProtocol`) 10 | 11 | ## Available Benchmarks 12 | 13 | ### 1. ScreenSpot-v2 (`ss-v2.py`) 14 | - **Dataset**: ScreenSpot-v2 (click-only GUI grounding) 15 | - **Format**: Standard resolution screenshots 16 | - **Task**: Predict click coordinates given an instruction and image 17 | - **Metrics**: Accuracy, Error Rate, Timing, VRAM usage 18 | 19 | ### 2. ScreenSpot-Pro (`ss-pro.py`) 20 | - **Dataset**: ScreenSpot-Pro (high-resolution click-only GUI grounding) 21 | - **Format**: High-resolution screenshots 22 | - **Task**: Predict click coordinates given an instruction and image 23 | - **Metrics**: Accuracy, Error Rate, Timing, VRAM usage 24 | 25 | ### 3. Interactive Testing (`interactive.py`) 26 | - **Real-time testing**: Take screenshots and visualize model predictions 27 | - **Commands**: 28 | - Type instruction → test all models on last screenshot 29 | - `screenshot` → take screenshot 30 | - `models` → list available models 31 | - `quit`/`exit` → exit tool 32 | - **Output**: Visual predictions with crosshairs for each model 33 | 34 | ## Running Benchmarks 35 | 36 | ### 1. Configure Models 37 | Edit `utils.py` to specify which models you want to test in `get_available_models()`. 38 | 39 | ### 2. Run Benchmark 40 | ```bash 41 | # ScreenSpot-v2 benchmark 42 | python ss-v2.py --samples 50 43 | 44 | # ScreenSpot-Pro benchmark 45 | python ss-pro.py --samples 50 46 | 47 | # Interactive testing 48 | python interactive.py 49 | ``` 50 | 51 | ## Output 52 | 53 | ### Console Output 54 | ``` 55 | Model Results: 56 | Accuracy: 85.50% (171/200) 57 | Avg Time: 1.23s (0.89s - 2.45s) 58 | VRAM Usage: 4.5GB (max) / 3.4GB (avg) 59 | ``` 60 | 61 | ### Generated Files 62 | - **Markdown Report**: `*_results.md` with detailed results tables 63 | - **Visualizations**: `output/` directory with prediction visualizations 64 | - **Interactive Output**: `interactive_output/` for interactive session results 65 | 66 | ## Contributing 67 | 68 | To add a new reference model, follow the instructions in [contrib.md](contrib.md). ``` -------------------------------------------------------------------------------- /.devcontainer/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Dev Container Setup 2 | 3 | This repository includes a Dev Container configuration that simplifies the development setup to just 3 steps: 4 | 5 | ## Quick Start 6 | 7 |  8 | 9 | 1. **Install the Dev Containers extension ([VS Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) or [WindSurf](https://docs.windsurf.com/windsurf/advanced#dev-containers-beta))** 10 | 2. **Open the repository in the Dev Container:** 11 | - Press `Ctrl+Shift+P` (or `⌘+Shift+P` on macOS) 12 | - Select `Dev Containers: Clone Repository in Container Volume...` and paste the repository URL: `https://github.com/trycua/cua.git` (if not cloned) or `Dev Containers: Open Folder in Container...` (if git cloned). 13 | > **Note**: On WindSurf, the post install hook might not run automatically. If so, run `/bin/bash .devcontainer/post-install.sh` manually. 14 | 3. **Open the VS Code workspace:** Once the post-install.sh is done running, open the `.vscode/py.code-workspace` workspace and press  15 | . 16 | 4. **Run the Agent UI example:** Click  17 | to start the Gradio UI. If prompted to install **debugpy (Python Debugger)** to enable remote debugging, select 'Yes' to proceed. 18 | 5. **Access the Gradio UI:** The Gradio UI will be available at `http://localhost:7860` and will automatically forward to your host machine. 19 | 20 | ## What's Included 21 | 22 | The dev container automatically: 23 | 24 | - ✅ Sets up Python 3.11 environment 25 | - ✅ Installs all system dependencies (build tools, OpenGL, etc.) 26 | - ✅ Configures Python paths for all packages 27 | - ✅ Installs Python extensions (Black, Ruff, Pylance) 28 | - ✅ Forwards port 7860 for the Gradio web UI 29 | - ✅ Mounts your source code for live editing 30 | - ✅ Creates the required `.env.local` file 31 | 32 | ## Running Examples 33 | 34 | After the container is built, you can run examples directly: 35 | 36 | ```bash 37 | # Run the agent UI (Gradio web interface) 38 | python examples/agent_ui_examples.py 39 | 40 | # Run computer examples 41 | python examples/computer_examples.py 42 | 43 | # Run computer UI examples 44 | python examples/computer_ui_examples.py 45 | ``` 46 | 47 | The Gradio UI will be available at `http://localhost:7860` and will automatically forward to your host machine. 48 | 49 | ## Environment Variables 50 | 51 | You'll need to add your API keys to `.env.local`: 52 | 53 | ```bash 54 | # Required for Anthropic provider 55 | ANTHROPIC_API_KEY=your_anthropic_key_here 56 | 57 | # Required for OpenAI provider 58 | OPENAI_API_KEY=your_openai_key_here 59 | ``` 60 | 61 | ## Notes 62 | 63 | - The container connects to `host.docker.internal:7777` for Lume server communication 64 | - All Python packages are pre-installed and configured 65 | - Source code changes are reflected immediately (no rebuild needed) 66 | - The container uses the same Dockerfile as the regular Docker development environment 67 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://www.npmjs.com/package/@trycua/computer) 15 | </h1> 16 | </div> 17 | 18 | **@trycua/computer** is a Computer-Use Interface (CUI) framework powering Cua for interacting with local macOS and Linux sandboxes, Playwright-compatible, and pluggable with any AI agent systems (Cua, Langchain, CrewAI, AutoGen). Computer relies on [Lume](https://github.com/trycua/lume) for creating and managing sandbox environments. 19 | 20 | ### Get started with Computer 21 | 22 | <div align="center"> 23 | <img src="https://raw.githubusercontent.com/trycua/cua/main/img/computer.png"/> 24 | </div> 25 | 26 | ```typescript 27 | import { Computer, OSType } from '@trycua/computer'; 28 | 29 | // Create a new computer instance 30 | const computer = new Computer({ 31 | osType: OSType.LINUX, 32 | name: 's-linux-vm_id', 33 | apiKey: 'your-api-key' 34 | }); 35 | 36 | // Start the computer 37 | await computer.run(); 38 | 39 | // Get the computer interface for interaction 40 | const computerInterface = computer.interface; 41 | 42 | // Take a screenshot 43 | const screenshot = await computerInterface.getScreenshot(); 44 | // In a Node.js environment, you might save it like this: 45 | // import * as fs from 'fs'; 46 | // fs.writeFileSync('screenshot.png', Buffer.from(screenshot)); 47 | 48 | // Click at coordinates 49 | await computerInterface.click(500, 300); 50 | 51 | // Type text 52 | await computerInterface.typeText('Hello, world!'); 53 | 54 | // Stop the computer 55 | await computer.stop(); 56 | ``` 57 | 58 | ## Install 59 | 60 | To install the Computer-Use Interface (CUI): 61 | 62 | ```bash 63 | npm install @trycua/computer 64 | # or 65 | pnpm add @trycua/computer 66 | ``` 67 | 68 | The `@trycua/computer` package provides the TypeScript library for interacting with computer interfaces. 69 | 70 | ## Run 71 | 72 | Refer to this example for a step-by-step guide on how to use the Computer-Use Interface (CUI): 73 | 74 | - [Computer-Use Interface (CUI)](https://github.com/trycua/cua/tree/main/examples/computer-example-ts) 75 | 76 | ## Docs 77 | 78 | - [Computers](https://trycua.com/docs/computer-sdk/computers) 79 | - [Commands](https://trycua.com/docs/computer-sdk/commands) 80 | - [Computer UI](https://trycua.com/docs/computer-sdk/computer-ui) 81 | 82 | ## License 83 | 84 | [MIT](./LICENSE) License 2025 [CUA](https://github.com/trycua) 85 | ``` -------------------------------------------------------------------------------- /libs/python/computer/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/cua-computer/) 15 | </h1> 16 | </div> 17 | 18 | **cua-computer** is a Computer-Use Interface (CUI) framework powering Cua for interacting with local macOS and Linux sandboxes, PyAutoGUI-compatible, and pluggable with any AI agent systems (Cua, Langchain, CrewAI, AutoGen). Computer relies on [Lume](https://github.com/trycua/lume) for creating and managing sandbox environments. 19 | 20 | ### Get started with Computer 21 | 22 | <div align="center"> 23 | <img src="https://raw.githubusercontent.com/trycua/cua/main/img/computer.png"/> 24 | </div> 25 | 26 | ```python 27 | from computer import Computer 28 | 29 | computer = Computer(os_type="macos", display="1024x768", memory="8GB", cpu="4") 30 | try: 31 | await computer.run() 32 | 33 | screenshot = await computer.interface.screenshot() 34 | with open("screenshot.png", "wb") as f: 35 | f.write(screenshot) 36 | 37 | await computer.interface.move_cursor(100, 100) 38 | await computer.interface.left_click() 39 | await computer.interface.right_click(300, 300) 40 | await computer.interface.double_click(400, 400) 41 | 42 | await computer.interface.type("Hello, World!") 43 | await computer.interface.press_key("enter") 44 | 45 | await computer.interface.set_clipboard("Test clipboard") 46 | content = await computer.interface.copy_to_clipboard() 47 | print(f"Clipboard content: {content}") 48 | finally: 49 | await computer.stop() 50 | ``` 51 | 52 | ## Install 53 | 54 | To install the Computer-Use Interface (CUI): 55 | 56 | ```bash 57 | pip install "cua-computer[all]" 58 | ``` 59 | 60 | The `cua-computer` PyPi package pulls automatically the latest executable version of Lume through [pylume](https://github.com/trycua/pylume). 61 | 62 | ## Run 63 | 64 | Refer to this notebook for a step-by-step guide on how to use the Computer-Use Interface (CUI): 65 | 66 | - [Computer-Use Interface (CUI)](https://github.com/trycua/cua/blob/main/notebooks/computer_nb.ipynb) 67 | 68 | ## Docs 69 | 70 | - [Computers](https://trycua.com/docs/computer-sdk/computers) 71 | - [Commands](https://trycua.com/docs/computer-sdk/commands) 72 | - [Computer UI](https://trycua.com/docs/computer-sdk/computer-ui) 73 | - [Sandboxed Python](https://trycua.com/docs/computer-sdk/sandboxed-python) 74 | ``` -------------------------------------------------------------------------------- /libs/python/mcp-server/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/cua-computer/) 15 | </h1> 16 | </div> 17 | 18 | **cua-mcp-server** is a MCP server for the Computer-Use Agent (CUA), allowing you to run CUA through Claude Desktop or other MCP clients. 19 | 20 | ### Get started with Agent 21 | 22 | ## Prerequisites 23 | 24 | Cua MCP Server requires [lume](https://github.com/trycua/cua/blob/main/libs/lume/README.md#install) to be installed. 25 | 26 | ## Install 27 | 28 | Download and run the installation script: 29 | 30 | ```bash 31 | curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/python/mcp-server/scripts/install_mcp_server.sh | bash 32 | ``` 33 | 34 | You can then use the script in your MCP configuration like this: 35 | 36 | ```json 37 | { 38 | "mcpServers": { 39 | "cua-agent": { 40 | "command": "/bin/bash", 41 | "args": ["~/.cua/start_mcp_server.sh"], 42 | "env": { 43 | "CUA_MODEL_NAME": "anthropic/claude-3-5-sonnet-20241022" 44 | } 45 | } 46 | } 47 | } 48 | ``` 49 | 50 | ## Development 51 | 52 | Use this configuration to develop with the cua-mcp-server directly without installation: 53 | 54 | ```json 55 | { 56 | "mcpServers": { 57 | "cua-agent": { 58 | "command": "/bin/bash", 59 | "args": ["~/cua/libs/python/mcp-server/scripts/start_mcp_server.sh"], 60 | "env": { 61 | "CUA_MODEL_NAME": "huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B" 62 | } 63 | } 64 | } 65 | } 66 | ``` 67 | 68 | This configuration: 69 | - Uses the start_mcp_server.sh script which automatically sets up the Python path and runs the server module 70 | - Works with Claude Desktop, Cursor, or any other MCP client 71 | - Automatically uses your development code without requiring installation 72 | 73 | Just add this to your MCP client's configuration and it will use your local development version of the server. 74 | 75 | ## Docs 76 | 77 | - [Installation](https://trycua.com/docs/libraries/mcp-server/installation) 78 | - [Configuration](https://trycua.com/docs/libraries/mcp-server/configuration) 79 | - [Usage](https://trycua.com/docs/libraries/mcp-server/usage) 80 | - [Tools](https://trycua.com/docs/libraries/mcp-server/tools) 81 | - [Client Integrations](https://trycua.com/docs/libraries/mcp-server/client-integrations) 82 | - [LLM Integrations](https://trycua.com/docs/libraries/mcp-server/llm-integrations) ``` -------------------------------------------------------------------------------- /libs/lume/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="../../img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="../../img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | </h1> 15 | </div> 16 | 17 | 18 | **lume** is a lightweight Command Line Interface and local API server to create, run and manage macOS and Linux virtual machines (VMs) with near-native performance on Apple Silicon, using Apple's `Virtualization.Framework`. 19 | 20 | ### Run prebuilt macOS images in just 1 step 21 | 22 | <div align="center"> 23 | <img src="../../img/cli.png" alt="lume cli"> 24 | </div> 25 | 26 | ```bash 27 | lume run macos-sequoia-vanilla:latest 28 | ``` 29 | 30 | ## Quickstart 31 | 32 | Install and run a prebuilt macOS VM in two commands: 33 | 34 | ```bash 35 | # Install Lume 36 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)" 37 | # Pull & start a macOS image 38 | lume run macos-sequoia-vanilla:latest 39 | ``` 40 | 41 | <Callout title="Security Note"> 42 | All prebuilt images use the default password `lume`. Change this immediately after your first login using the `passwd` command. 43 | </Callout> 44 | 45 | **System Requirements**: 46 | - Apple Silicon Mac (M1, M2, M3, etc.) 47 | - macOS 13.0 or later 48 | - At least 8GB of RAM (16GB recommended) 49 | - At least 50GB of free disk space 50 | 51 | ## Development 52 | 53 | To get set up with Lume for development, read [these instructions](Development.md). 54 | 55 | ## Docs 56 | 57 | - [Installation](https://trycua.com/docs/libraries/lume/installation) 58 | - [Prebuilt Images](https://trycua.com/docs/libraries/lume/prebuilt-images) 59 | - [CLI Reference](https://trycua.com/docs/libraries/lume/cli-reference) 60 | - [HTTP API](https://trycua.com/docs/libraries/lume/http-api) 61 | - [FAQ](https://trycua.com/docs/libraries/lume/faq) 62 | 63 | ## Contributing 64 | 65 | We welcome and greatly appreciate contributions to lume! Whether you're improving documentation, adding new features, fixing bugs, or adding new VM images, your efforts help make lume better for everyone. For detailed instructions on how to contribute, please refer to our [Contributing Guidelines](CONTRIBUTING.md). 66 | 67 | Join our [Discord community](https://discord.com/invite/mVnXXpdE85) to discuss ideas or get assistance. 68 | 69 | ## License 70 | 71 | lume is open-sourced under the MIT License - see the [LICENSE](LICENSE) file for details. 72 | 73 | ## Trademarks 74 | 75 | Apple, macOS, and Apple Silicon are trademarks of Apple Inc. Ubuntu and Canonical are registered trademarks of Canonical Ltd. This project is not affiliated with, endorsed by, or sponsored by Apple Inc. or Canonical Ltd. 76 | ``` -------------------------------------------------------------------------------- /libs/kasm/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # CUA Ubuntu Container 2 | 3 | Containerized virtual desktop for Computer-Using Agents (CUA). Utilizes Kasm's MIT-licensed Ubuntu XFCE container as a base with computer-server pre-installed. 4 | 5 | ## Features 6 | 7 | - Ubuntu 22.04 (Jammy) with XFCE desktop environment 8 | - Pre-installed computer-server for remote computer control 9 | - VNC access for visual desktop interaction 10 | - Python 3.11 with necessary libraries 11 | - Screen capture tools (gnome-screenshot, wmctrl, ffmpeg) 12 | - Clipboard utilities (xclip, socat) 13 | 14 | ## Usage 15 | 16 | ### Building the Container 17 | 18 | ```bash 19 | docker build -t cua-ubuntu:latest . 20 | ``` 21 | 22 | ### Pushing to Registry 23 | 24 | ```bash 25 | # Tag for Docker Hub (replace 'trycua' with your Docker Hub username) 26 | docker tag cua-ubuntu:latest trycua/cua-ubuntu:latest 27 | 28 | # Login to Docker Hub 29 | docker login 30 | 31 | # Push to Docker Hub 32 | docker push trycua/cua-ubuntu:latest 33 | ``` 34 | 35 | ### Running the Container Manually 36 | 37 | ```bash 38 | docker run --rm -it --shm-size=512m -p 6901:6901 -p 8000:8000 -e VNCOPTIONS=-disableBasicAuth cua-ubuntu:latest 39 | ``` 40 | 41 | - **VNC Access**: Available at `http://localhost:6901` 42 | - **Computer Server API**: Available at `http://localhost:8000` 43 | 44 | ### Using with CUA Docker Provider 45 | 46 | This container is designed to work with the CUA Docker provider for automated container management: 47 | 48 | ```python 49 | from computer.providers.factory import VMProviderFactory 50 | 51 | # Create docker provider 52 | provider = VMProviderFactory.create_provider( 53 | provider_type="docker", 54 | image="cua-ubuntu:latest", 55 | port=8000, # computer-server API port 56 | noVNC_port=6901 # VNC port 57 | ) 58 | 59 | # Run a container 60 | async with provider: 61 | vm_info = await provider.run_vm( 62 | image="cua-ubuntu:latest", 63 | name="my-cua-container", 64 | run_opts={ 65 | "memory": "4GB", 66 | "cpu": 2, 67 | "vnc_port": 6901, 68 | "api_port": 8000 69 | } 70 | ) 71 | ``` 72 | 73 | ## Container Configuration 74 | 75 | ### Ports 76 | - **6901**: VNC web interface (noVNC) 77 | - **8080**: Computer-server API endpoint 78 | 79 | ### Environment Variables 80 | - `VNC_PW`: VNC password (default: "password") 81 | - `DISPLAY`: X11 display (set to ":0") 82 | 83 | ### Volumes 84 | - `/home/kasm-user/storage`: Persistent storage mount point 85 | - `/home/kasm-user/shared`: Shared folder mount point 86 | 87 | ## Creating Filesystem Snapshots 88 | 89 | You can create a filesystem snapshot of the container at any time: 90 | 91 | ```bash 92 | docker commit <container_id> cua-ubuntu-snapshot:latest 93 | ``` 94 | 95 | Then run the snapshot: 96 | 97 | ```bash 98 | docker run --rm -it --shm-size=512m -p 6901:6901 -p 8080:8080 -e VNCOPTIONS=-disableBasicAuth cua-ubuntu-snapshot:latest 99 | ``` 100 | 101 | Memory snapshots are available using the experimental `docker checkpoint` command. [Docker Checkpoint Documentation](https://docs.docker.com/reference/cli/docker/checkpoint/) 102 | 103 | ## Integration with CUA System 104 | 105 | This container integrates seamlessly with the CUA computer provider system: 106 | 107 | - **Automatic Management**: Use the Docker provider for lifecycle management 108 | - **Resource Control**: Configure memory, CPU, and storage limits 109 | - **Network Access**: Automatic port mapping and IP detection 110 | - **Storage Persistence**: Mount host directories for persistent data 111 | - **Monitoring**: Real-time container status and health checking 112 | ``` -------------------------------------------------------------------------------- /libs/python/som/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/cua-computer/) 15 | </h1> 16 | </div> 17 | 18 | **Som** (Set-of-Mark) is a visual grounding component for the Computer-Use Agent (CUA) framework powering Cua, for detecting and analyzing UI elements in screenshots. Optimized for macOS Silicon with Metal Performance Shaders (MPS), it combines YOLO-based icon detection with EasyOCR text recognition to provide comprehensive UI element analysis. 19 | 20 | ## Features 21 | 22 | - Optimized for Apple Silicon with MPS acceleration 23 | - Icon detection using YOLO with multi-scale processing 24 | - Text recognition using EasyOCR (GPU-accelerated) 25 | - Automatic hardware detection (MPS → CUDA → CPU) 26 | - Smart detection parameters tuned for UI elements 27 | - Detailed visualization with numbered annotations 28 | - Performance benchmarking tools 29 | 30 | ## System Requirements 31 | 32 | - **Recommended**: macOS with Apple Silicon 33 | - Uses Metal Performance Shaders (MPS) 34 | - Multi-scale detection enabled 35 | - ~0.4s average detection time 36 | 37 | - **Supported**: Any Python 3.11+ environment 38 | - Falls back to CPU if no GPU available 39 | - Single-scale detection on CPU 40 | - ~1.3s average detection time 41 | 42 | ## Installation 43 | 44 | ```bash 45 | # Using PDM (recommended) 46 | pdm install 47 | 48 | # Using pip 49 | pip install -e . 50 | ``` 51 | 52 | ## Quick Start 53 | 54 | ```python 55 | from som import OmniParser 56 | from PIL import Image 57 | 58 | # Initialize parser 59 | parser = OmniParser() 60 | 61 | # Process an image 62 | image = Image.open("screenshot.png") 63 | result = parser.parse( 64 | image, 65 | box_threshold=0.3, # Confidence threshold 66 | iou_threshold=0.1, # Overlap threshold 67 | use_ocr=True # Enable text detection 68 | ) 69 | 70 | # Access results 71 | for elem in result.elements: 72 | if elem.type == "icon": 73 | print(f"Icon: confidence={elem.confidence:.3f}, bbox={elem.bbox.coordinates}") 74 | else: # text 75 | print(f"Text: '{elem.content}', confidence={elem.confidence:.3f}") 76 | ``` 77 | 78 | ## Docs 79 | 80 | - [Configuration](http://localhost:8090/docs/libraries/som/configuration) 81 | 82 | ## Development 83 | 84 | ### Test Data 85 | - Place test screenshots in `examples/test_data/` 86 | - Not tracked in git to keep repository size manageable 87 | - Default test image: `test_screen.png` (1920x1080) 88 | 89 | ### Running Tests 90 | ```bash 91 | # Run benchmark with no OCR 92 | python examples/omniparser_examples.py examples/test_data/test_screen.png --runs 5 --ocr none 93 | 94 | # Run benchmark with OCR 95 | python examples/omniparser_examples.py examples/test_data/test_screen.png --runs 5 --ocr easyocr 96 | ``` 97 | 98 | ## License 99 | 100 | MIT License - See LICENSE file for details. 101 | ``` -------------------------------------------------------------------------------- /libs/lumier/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="../../img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="../../img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | </h1> 15 | </div> 16 | 17 | macOS and Linux virtual machines in a Docker container. 18 | 19 | <div align="center"> 20 | <video src="https://github.com/user-attachments/assets/2ecca01c-cb6f-4c35-a5a7-69bc58bd94e2" width="800" controls></video> 21 | </div> 22 | 23 | ## What is Lumier? 24 | **Lumier** is an interface for running macOS virtual machines with minimal setup. It uses Docker as a packaging system to deliver a pre-configured environment that connects to the `lume` virtualization service running on your host machine. With Lumier, you get: 25 | 26 | - A ready-to-use macOS or Linux virtual machine in minutes 27 | - Browser-based VNC access to your VM 28 | - Easy file sharing between your host and VM 29 | - Simple configuration through environment variables 30 | 31 | ## Requirements 32 | 33 | Before using Lumier, make sure you have: 34 | 35 | 1. **Docker for Apple Silicon** - download it [here](https://desktop.docker.com/mac/main/arm64/Docker.dmg) and follow the installation instructions. 36 | 37 | 2. **Lume** - This is the virtualization CLI that powers Lumier. Install it with this command: 38 | ```bash 39 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)" 40 | ``` 41 | 42 | ## Getting Started 43 | 44 | ```bash 45 | # Run the container with temporary storage (using pre-built image from Docker Hub) 46 | docker run -it --rm \ 47 | --name macos-vm \ 48 | -p 8006:8006 \ 49 | -e VM_NAME=macos-vm \ 50 | -e VERSION=ghcr.io/trycua/macos-sequoia-cua:latest \ 51 | -e CPU_CORES=4 \ 52 | -e RAM_SIZE=8192 \ 53 | trycua/lumier:latest 54 | ``` 55 | 56 | After running the command above, you can access your macOS VM through a web browser (e.g., http://localhost:8006). 57 | 58 | > **Note:** With the basic setup above, your VM will be reset when you stop the container (ephemeral mode). This means any changes you make inside the macOS VM will be lost. See [the documentation](https://trycua.com/docs/libraries/lumier/docker) for how to save your VM state. 59 | 60 | ## Docs 61 | 62 | - [Installation](https://trycua.com/docs/libraries/lumier/installation) 63 | - [Docker](https://trycua.com/docs/libraries/lumier/docker) 64 | - [Docker Compose](https://trycua.com/docs/libraries/lumier/docker-compose) 65 | - [Building Lumier](https://trycua.com/docs/libraries/lumier/building-lumier) 66 | 67 | ## Credits 68 | 69 | This project was inspired by [dockur/windows](https://github.com/dockur/windows) and [dockur/macos](https://github.com/dockur/macos), which pioneered the approach of running Windows and macOS VMs in Docker containers. 70 | 71 | Main differences with dockur/macos: 72 | - Lumier is specifically designed for macOS virtualization 73 | - Lumier supports Apple Silicon (M1/M2/M3/M4) while dockur/macos only supports Intel 74 | - Lumier uses the Apple Virtualization Framework (Vz) through the `lume` CLI to create true virtual machines, while dockur relies on KVM. 75 | - Image specification is different, with Lumier and Lume relying on Apple Vz spec (disk.img and nvram.bin) 76 | ``` -------------------------------------------------------------------------------- /libs/python/agent/README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <h1> 3 | <div class="image-wrapper" style="display: inline-block;"> 4 | <picture> 5 | <source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_white.png" style="display: block; margin: auto;"> 6 | <source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="https://raw.githubusercontent.com/trycua/cua/main/img/logo_black.png" style="display: block; margin: auto;"> 7 | <img alt="Shows my svg"> 8 | </picture> 9 | </div> 10 | 11 | [](#) 12 | [](#) 13 | [](https://discord.com/invite/mVnXXpdE85) 14 | [](https://pypi.org/project/cua-computer/) 15 | </h1> 16 | </div> 17 | 18 | **cua-agent** is a general Computer-Use framework with liteLLM integration for running agentic workflows on macOS, Windows, and Linux sandboxes. It provides a unified interface for computer-use agents across multiple LLM providers with advanced callback system for extensibility. 19 | 20 | ## Features 21 | 22 | - **Safe Computer-Use/Tool-Use**: Using Computer SDK for sandboxed desktops 23 | - **Multi-Agent Support**: Anthropic Claude, OpenAI computer-use-preview, UI-TARS, Omniparser + any LLM 24 | - **Multi-API Support**: Take advantage of liteLLM supporting 100+ LLMs / model APIs, including local models (`huggingface-local/`, `ollama_chat/`, `mlx/`) 25 | - **Cross-Platform**: Works on Windows, macOS, and Linux with cloud and local computer instances 26 | - **Extensible Callbacks**: Built-in support for image retention, cache control, PII anonymization, budget limits, and trajectory tracking 27 | 28 | ## Install 29 | 30 | ```bash 31 | pip install "cua-agent[all]" 32 | ``` 33 | 34 | ## Quick Start 35 | 36 | ```python 37 | import asyncio 38 | import os 39 | from agent import ComputerAgent 40 | from computer import Computer 41 | 42 | async def main(): 43 | # Set up computer instance 44 | async with Computer( 45 | os_type="linux", 46 | provider_type="cloud", 47 | name=os.getenv("CUA_CONTAINER_NAME"), 48 | api_key=os.getenv("CUA_API_KEY") 49 | ) as computer: 50 | 51 | # Create agent 52 | agent = ComputerAgent( 53 | model="anthropic/claude-3-5-sonnet-20241022", 54 | tools=[computer], 55 | only_n_most_recent_images=3, 56 | trajectory_dir="trajectories", 57 | max_trajectory_budget=5.0 # $5 budget limit 58 | ) 59 | 60 | # Run agent 61 | messages = [{"role": "user", "content": "Take a screenshot and tell me what you see"}] 62 | 63 | async for result in agent.run(messages): 64 | for item in result["output"]: 65 | if item["type"] == "message": 66 | print(item["content"][0]["text"]) 67 | 68 | if __name__ == "__main__": 69 | asyncio.run(main()) 70 | ``` 71 | 72 | ## Docs 73 | 74 | - [Agent Loops](https://trycua.com/docs/agent-sdk/agent-loops) 75 | - [Supported Agents](https://trycua.com/docs/agent-sdk/supported-agents) 76 | - [Supported Models](https://trycua.com/docs/agent-sdk/supported-models) 77 | - [Chat History](https://trycua.com/docs/agent-sdk/chat-history) 78 | - [Callbacks](https://trycua.com/docs/agent-sdk/callbacks) 79 | - [Custom Tools](https://trycua.com/docs/agent-sdk/custom-tools) 80 | - [Custom Computer Handlers](https://trycua.com/docs/agent-sdk/custom-computer-handlers) 81 | - [Prompt Caching](https://trycua.com/docs/agent-sdk/prompt-caching) 82 | - [Usage Tracking](https://trycua.com/docs/agent-sdk/usage-tracking) 83 | - [Benchmarks](https://trycua.com/docs/agent-sdk/benchmarks) 84 | 85 | ## License 86 | 87 | MIT License - see LICENSE file for details. ``` -------------------------------------------------------------------------------- /libs/typescript/agent/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # @trycua/agent 2 | 3 | TypeScript SDK for CUA agent interaction. Connect to CUA agent proxies via HTTP/HTTPS or peer-to-peer (WebRTC) connections. 4 | 5 | ## Installation 6 | 7 | ```bash 8 | npm install @trycua/agent 9 | # or 10 | pnpm add @trycua/agent 11 | # or 12 | yarn add @trycua/agent 13 | ``` 14 | 15 | ## Usage 16 | 17 | ### Basic Usage 18 | 19 | ```typescript 20 | import AgentClient from "@trycua/agent"; 21 | 22 | // Connect to local HTTP server 23 | const client = new AgentClient("https://localhost:8000"); 24 | 25 | // Connect to a cloud container (port 8443 over HTTPS) 26 | const cloud = new AgentClient( 27 | "https://m-linux-96lcxd2c2k.containers.cloud.trycua.com:8443", 28 | { apiKey: process.env.NEXT_PUBLIC_CUA_API_KEY || "" } 29 | ); 30 | 31 | // Connect to peer 32 | const peerClient = new AgentClient("peer://my-agent-proxy"); 33 | 34 | // Send a simple text request 35 | const response = await client.responses.create({ 36 | model: "anthropic/claude-3-5-sonnet-20241022", 37 | input: "Write a one-sentence bedtime story about a unicorn.", 38 | // Optional per-request env overrides 39 | env: { 40 | OPENAI_API_KEY: "sk-..." 41 | } 42 | }); 43 | 44 | console.log(response.output); 45 | ``` 46 | 47 | ### Multi-modal Requests 48 | 49 | ```typescript 50 | const response = await client.responses.create({ 51 | model: "anthropic/claude-3-5-sonnet-20241022", 52 | input: [ 53 | { 54 | role: "user", 55 | content: [ 56 | { type: "input_text", text: "What is in this image?" }, 57 | { 58 | type: "input_image", 59 | image_url: "https://example.com/image.jpg" 60 | } 61 | ] 62 | } 63 | ], 64 | env: { OPENROUTER_API_KEY: "sk-..." } 65 | }); 66 | ``` 67 | 68 | ### Advanced Configuration 69 | 70 | ```typescript 71 | const client = new AgentClient("https://localhost:8000", { 72 | timeout: 60000, // 60 second timeout 73 | retries: 5, // 5 retry attempts 74 | apiKey: "cua_...", // sent as X-API-Key header when using HTTP/HTTPS 75 | }); 76 | 77 | const response = await client.responses.create({ 78 | model: "anthropic/claude-3-5-sonnet-20241022", 79 | input: "Hello, world!", 80 | agent_kwargs: { 81 | save_trajectory: true, 82 | verbosity: 20 83 | }, 84 | computer_kwargs: { 85 | os_type: "linux", 86 | provider_type: "cloud" 87 | }, 88 | // Per-request env overrides 89 | env: { 90 | ANTHROPIC_API_KEY: "sk-...", 91 | OPENROUTER_API_KEY: "sk-..." 92 | } 93 | }); 94 | ``` 95 | 96 | ### Health Check 97 | 98 | ```typescript 99 | const health = await client.health(); 100 | console.log(health.status); // 'healthy', 'unhealthy', 'unreachable', 'connected', 'disconnected' 101 | ``` 102 | 103 | ### Cleanup 104 | 105 | ```typescript 106 | // Clean up peer connections when done 107 | await client.disconnect(); 108 | ``` 109 | 110 | ## API Reference 111 | 112 | ### AgentClient 113 | 114 | #### Constructor 115 | 116 | ```typescript 117 | new AgentClient(url: string, options?: AgentClientOptions) 118 | ``` 119 | 120 | - `url`: Connection URL. Supports `http://`, `https://`, or `peer://` protocols 121 | - `options`: Optional configuration object 122 | 123 | #### Methods 124 | 125 | ##### responses.create(request: AgentRequest): Promise<AgentResponse> 126 | 127 | Send a request to the agent and get a response. 128 | 129 | ##### health(): Promise<{status: string}> 130 | 131 | Check the health/connection status of the agent. 132 | 133 | ##### disconnect(): Promise<void> 134 | 135 | Clean up resources and close connections. 136 | 137 | ### Types 138 | 139 | #### AgentRequest 140 | 141 | ```typescript 142 | interface AgentRequest { 143 | model: string; 144 | input: string | AgentMessage[]; 145 | agent_kwargs?: { 146 | save_trajectory?: boolean; 147 | verbosity?: number; 148 | [key: string]: any; 149 | }; 150 | computer_kwargs?: { 151 | os_type?: string; 152 | provider_type?: string; 153 | [key: string]: any; 154 | }; 155 | // Optional per-request environment overrides 156 | env?: Record<string, string>; 157 | } 158 | ``` 159 | 160 | #### AgentResponse 161 | 162 | ```typescript 163 | interface AgentResponse { 164 | output: AgentMessage[]; 165 | usage: Usage; 166 | } 167 | 168 | interface Usage { 169 | prompt_tokens: number; 170 | completion_tokens: number; 171 | total_tokens: number; 172 | response_cost: number; 173 | } 174 | ``` 175 | 176 | The `output` array contains the conversation history including: 177 | - User messages 178 | - Agent reasoning/thinking 179 | - Computer actions and their results 180 | - Final agent responses 181 | 182 | The `usage` object provides token counts and cost information for the request. 183 | 184 | ## Connection Types 185 | 186 | ### HTTP/HTTPS 187 | 188 | Connect to a CUA agent proxy server: 189 | 190 | ```typescript 191 | // Local 192 | const client = new AgentClient("https://my-agent-server.com:8000", { apiKey: "cua_..." }); 193 | 194 | // Cloud container (port 8443) 195 | const cloud = new AgentClient( 196 | "https://m-linux-96lcxd2c2k.containers.cloud.trycua.com:8443", 197 | { apiKey: "cua_..." } 198 | ); 199 | ``` 200 | 201 | Notes: 202 | - The client sends the API key as `X-API-Key` for HTTP/HTTPS connections. 203 | - Cloud containers listen on `:8443` with HTTPS. 204 | 205 | ### Peer-to-Peer (WebRTC) 206 | 207 | Connect directly to another peer using WebRTC: 208 | 209 | ```typescript 210 | const client = new AgentClient("peer://agent-proxy-peer-id"); 211 | ``` 212 | 213 | The client uses PeerJS with default configuration for peer connections. 214 | 215 | ## License 216 | 217 | MIT 218 | ``` -------------------------------------------------------------------------------- /.github/scripts/tests/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Tests for .github/scripts 2 | 3 | This directory contains comprehensive tests for the GitHub workflow scripts using Python's built-in testing framework. 4 | 5 | ## Requirements 6 | 7 | **No external dependencies required!** 8 | 9 | This test suite uses: 10 | - `unittest` - Python's built-in testing framework 11 | - `tomllib` - Python 3.11+ built-in TOML parser 12 | 13 | For Python < 3.11, the `toml` package is used as a fallback. 14 | 15 | ## Running Tests 16 | 17 | ### Run all tests 18 | ```bash 19 | cd .github/scripts/tests 20 | python3 -m unittest discover -v 21 | ``` 22 | 23 | ### Run a specific test file 24 | ```bash 25 | python3 -m unittest test_get_pyproject_version -v 26 | ``` 27 | 28 | ### Run a specific test class 29 | ```bash 30 | python3 -m unittest test_get_pyproject_version.TestGetPyprojectVersion -v 31 | ``` 32 | 33 | ### Run a specific test method 34 | ```bash 35 | python3 -m unittest test_get_pyproject_version.TestGetPyprojectVersion.test_matching_versions -v 36 | ``` 37 | 38 | ### Run tests directly from the test file 39 | ```bash 40 | python3 test_get_pyproject_version.py 41 | ``` 42 | 43 | ## Test Structure 44 | 45 | ### test_get_pyproject_version.py 46 | 47 | Comprehensive tests for `get_pyproject_version.py` covering: 48 | 49 | - ✅ **Version matching**: Tests successful version validation 50 | - ✅ **Version mismatch**: Tests error handling when versions don't match 51 | - ✅ **Missing version**: Tests handling of pyproject.toml without version field 52 | - ✅ **Missing project section**: Tests handling of pyproject.toml without project section 53 | - ✅ **File not found**: Tests handling of non-existent files 54 | - ✅ **Malformed TOML**: Tests handling of invalid TOML syntax 55 | - ✅ **Argument validation**: Tests proper argument count validation 56 | - ✅ **Semantic versioning**: Tests various semantic version formats 57 | - ✅ **Pre-release tags**: Tests versions with alpha, beta, rc tags 58 | - ✅ **Build metadata**: Tests versions with build metadata 59 | - ✅ **Edge cases**: Tests empty versions and other edge cases 60 | 61 | **Total Tests**: 17+ test cases covering all functionality 62 | 63 | ## Best Practices Implemented 64 | 65 | 1. **Fixture Management**: Uses `setUp()` and `tearDown()` for clean test isolation 66 | 2. **Helper Methods**: Provides reusable helpers for creating test fixtures 67 | 3. **Temporary Files**: Uses `tempfile` for file creation with proper cleanup 68 | 4. **Comprehensive Coverage**: Tests happy paths, error conditions, and edge cases 69 | 5. **Clear Documentation**: Each test has a descriptive docstring 70 | 6. **Output Capture**: Uses `unittest.mock.patch` and `StringIO` to test stdout/stderr 71 | 7. **Exit Code Validation**: Properly tests script exit codes with `assertRaises(SystemExit)` 72 | 8. **Type Hints**: Uses type hints in helper methods for clarity 73 | 9. **PEP 8 Compliance**: Follows Python style guidelines 74 | 10. **Zero External Dependencies**: Uses only Python standard library 75 | 76 | ## Continuous Integration 77 | 78 | These tests can be integrated into GitHub Actions workflows with no additional dependencies: 79 | 80 | ```yaml 81 | - name: Run .github scripts tests 82 | run: | 83 | cd .github/scripts/tests 84 | python3 -m unittest discover -v 85 | ``` 86 | 87 | ## Test Output Example 88 | 89 | ``` 90 | test_empty_version_string (test_get_pyproject_version.TestGetPyprojectVersion) 91 | Test handling of empty version string. ... ok 92 | test_file_not_found (test_get_pyproject_version.TestGetPyprojectVersion) 93 | Test handling of non-existent pyproject.toml file. ... ok 94 | test_malformed_toml (test_get_pyproject_version.TestGetPyprojectVersion) 95 | Test handling of malformed TOML file. ... ok 96 | test_matching_versions (test_get_pyproject_version.TestGetPyprojectVersion) 97 | Test that matching versions result in success. ... ok 98 | test_missing_project_section (test_get_pyproject_version.TestGetPyprojectVersion) 99 | Test handling of pyproject.toml without a project section. ... ok 100 | test_missing_version_field (test_get_pyproject_version.TestGetPyprojectVersion) 101 | Test handling of pyproject.toml without a version field. ... ok 102 | test_no_arguments (test_get_pyproject_version.TestGetPyprojectVersion) 103 | Test that providing no arguments results in usage error. ... ok 104 | test_semantic_version_0_0_1 (test_get_pyproject_version.TestGetPyprojectVersion) 105 | Test semantic version 0.0.1. ... ok 106 | test_semantic_version_1_0_0 (test_get_pyproject_version.TestGetPyprojectVersion) 107 | Test semantic version 1.0.0. ... ok 108 | test_semantic_version_10_20_30 (test_get_pyproject_version.TestGetPyprojectVersion) 109 | Test semantic version 10.20.30. ... ok 110 | test_semantic_version_alpha (test_get_pyproject_version.TestGetPyprojectVersion) 111 | Test semantic version with alpha tag. ... ok 112 | test_semantic_version_beta (test_get_pyproject_version.TestGetPyprojectVersion) 113 | Test semantic version with beta tag. ... ok 114 | test_semantic_version_rc_with_build (test_get_pyproject_version.TestGetPyprojectVersion) 115 | Test semantic version with rc and build metadata. ... ok 116 | test_too_few_arguments (test_get_pyproject_version.TestGetPyprojectVersion) 117 | Test that providing too few arguments results in usage error. ... ok 118 | test_too_many_arguments (test_get_pyproject_version.TestGetPyprojectVersion) 119 | Test that providing too many arguments results in usage error. ... ok 120 | test_version_mismatch (test_get_pyproject_version.TestGetPyprojectVersion) 121 | Test that mismatched versions result in failure with appropriate error message. ... ok 122 | test_version_with_build_metadata (test_get_pyproject_version.TestGetPyprojectVersion) 123 | Test matching versions with build metadata. ... ok 124 | test_version_with_prerelease_tags (test_get_pyproject_version.TestGetPyprojectVersion) 125 | Test matching versions with pre-release tags like alpha, beta, rc. ... ok 126 | 127 | ---------------------------------------------------------------------- 128 | Ran 18 tests in 0.XXXs 129 | 130 | OK 131 | ``` 132 | ``` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- ```markdown 1 | <div align="center"> 2 | <picture> 3 | <source media="(prefers-color-scheme: dark)" alt="Cua logo" height="150" srcset="img/logo_white.png"> 4 | <source media="(prefers-color-scheme: light)" alt="Cua logo" height="150" srcset="img/logo_black.png"> 5 | <img alt="Cua logo" height="150" src="img/logo_black.png"> 6 | </picture> 7 | 8 | [](#) 9 | [](#) 10 | [](#) 11 | [](https://discord.com/invite/mVnXXpdE85) 12 | <br> 13 | <a href="https://trendshift.io/repositories/13685" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13685" alt="trycua%2Fcua | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> 14 | </div> 15 | 16 | > We’re hosting the **Computer-Use Agents SOTA Challenge** at [Hack the North](https://hackthenorth.com) and online! 17 | >> **Track A (On-site @ UWaterloo)**: Reserved for participants accepted to Hack the North. 🏆 Prize: **YC interview guaranteed**. 18 | >> **Track B (Remote)**: Open to everyone worldwide. 🏆 Prize: **Cash award**. 19 | >>> 👉 Sign up here: [trycua.com/hackathon](https://www.trycua.com/hackathon) 20 | 21 | **cua** ("koo-ah") is Docker for [Computer-Use Agents](https://www.oneusefulthing.org/p/when-you-give-a-claude-a-mouse) - it enables AI agents to control full operating systems in virtual containers and deploy them locally or to the cloud. 22 | 23 | <div align="center"> 24 | <video src="https://github.com/user-attachments/assets/c619b4ea-bb8e-4382-860e-f3757e36af20" width="600" controls></video> 25 | </div> 26 | 27 | With the Computer SDK, you can: 28 | - automate Windows, Linux, and macOS VMs with a consistent, [pyautogui-like API](https://docs.trycua.com/docs/libraries/computer#interface-actions) 29 | - create & manage VMs [locally](https://docs.trycua.com/docs/computer-sdk/computers#cua-local-containers) or using [cua cloud](https://www.trycua.com/) 30 | 31 | With the Agent SDK, you can: 32 | - run computer-use models with a [consistent schema](https://docs.trycua.com/docs/agent-sdk/message-format) 33 | - benchmark on OSWorld-Verified, SheetBench-V2, and more [with a single line of code using HUD](https://docs.trycua.com/docs/agent-sdk/integrations/hud) ([Notebook](https://github.com/trycua/cua/blob/main/notebooks/eval_osworld.ipynb)) 34 | - combine UI grounding models with any LLM using [composed agents](https://docs.trycua.com/docs/agent-sdk/supported-agents/composed-agents) 35 | - use new UI agent models and UI grounding models from the Model Zoo below with just a model string (e.g., `ComputerAgent(model="openai/computer-use-preview")`) 36 | - use API or local inference by changing a prefix (e.g., `openai/`, `openrouter/`, `ollama/`, `huggingface-local/`, `mlx/`, [etc.](https://docs.litellm.ai/docs/providers)) 37 | 38 | ### CUA Model Zoo 🐨 39 | 40 | | [All-in-one CUAs](https://docs.trycua.com/docs/agent-sdk/supported-agents/computer-use-agents) | [UI Grounding Models](https://docs.trycua.com/docs/agent-sdk/supported-agents/composed-agents) | [UI Planning Models](https://docs.trycua.com/docs/agent-sdk/supported-agents/composed-agents) | 41 | |---|---|---| 42 | | `anthropic/claude-sonnet-4-5-20250929` | `huggingface-local/xlangai/OpenCUA-{7B,32B}` | any all-in-one CUA | 43 | | `openai/computer-use-preview` | `huggingface-local/HelloKKMe/GTA1-{7B,32B,72B}` | any VLM (using liteLLM, requires `tools` parameter) | 44 | | `openrouter/z-ai/glm-4.5v` | `huggingface-local/Hcompany/Holo1.5-{3B,7B,72B}` | any LLM (using liteLLM, requires `moondream3+` prefix ) | 45 | | `huggingface-local/OpenGVLab/InternVL3_5-{1B,2B,4B,8B,...}` | any all-in-one CUA | | 46 | | `huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B` | | 47 | | `moondream3+{ui planning}` (supports text-only models) | | 48 | | `omniparser+{ui planning}` | | | 49 | | `{ui grounding}+{ui planning}` | | | 50 | 51 | - `human/human` → [Human-in-the-Loop](https://docs.trycua.com/docs/agent-sdk/supported-agents/human-in-the-loop) 52 | 53 | Missing a model? [Raise a feature request](https://github.com/trycua/cua/issues/new?assignees=&labels=enhancement&projects=&title=%5BAgent%5D%3A+Add+model+support+for+) or [contribute](https://github.com/trycua/cua/blob/main/CONTRIBUTING.md)! 54 | 55 | <br/> 56 | 57 | # Quick Start 58 | 59 | - [Get started with a Computer-Use Agent UI](https://docs.trycua.com/docs/quickstart-ui) 60 | - [Get started with the Computer-Use Agent CLI](https://docs.trycua.com/docs/quickstart-cli) 61 | - [Get started with the Python SDKs](https://docs.trycua.com/docs/quickstart-devs) 62 | 63 | <br/> 64 | 65 | # Usage ([Docs](https://docs.trycua.com/docs)) 66 | 67 | ```bash 68 | pip install cua-agent[all] 69 | ``` 70 | ```python 71 | from agent import ComputerAgent 72 | 73 | agent = ComputerAgent( 74 | model="anthropic/claude-3-5-sonnet-20241022", 75 | tools=[computer], 76 | max_trajectory_budget=5.0 77 | ) 78 | 79 | messages = [{"role": "user", "content": "Take a screenshot and tell me what you see"}] 80 | 81 | async for result in agent.run(messages): 82 | for item in result["output"]: 83 | if item["type"] == "message": 84 | print(item["content"][0]["text"]) 85 | ``` 86 | 87 | ### Output format (OpenAI Agent Responses Format): 88 | ```json 89 | { 90 | "output": [ 91 | # user input 92 | { 93 | "role": "user", 94 | "content": "go to trycua on gh" 95 | }, 96 | # first agent turn adds the model output to the history 97 | { 98 | "summary": [ 99 | { 100 | "text": "Searching Firefox for Trycua GitHub", 101 | "type": "summary_text" 102 | } 103 | ], 104 | "type": "reasoning" 105 | }, 106 | { 107 | "action": { 108 | "text": "Trycua GitHub", 109 | "type": "type" 110 | }, 111 | "call_id": "call_QI6OsYkXxl6Ww1KvyJc4LKKq", 112 | "status": "completed", 113 | "type": "computer_call" 114 | }, 115 | # second agent turn adds the computer output to the history 116 | { 117 | "type": "computer_call_output", 118 | "call_id": "call_QI6OsYkXxl6Ww1KvyJc4LKKq", 119 | "output": { 120 | "type": "input_image", 121 | "image_url": "data:image/png;base64,..." 122 | } 123 | }, 124 | # final agent turn adds the agent output text to the history 125 | { 126 | "type": "message", 127 | "role": "assistant", 128 | "content": [ 129 | { 130 | "text": "Success! The Trycua GitHub page has been opened.", 131 | "type": "output_text" 132 | } 133 | ] 134 | } 135 | ], 136 | "usage": { 137 | "prompt_tokens": 150, 138 | "completion_tokens": 75, 139 | "total_tokens": 225, 140 | "response_cost": 0.01, 141 | } 142 | } 143 | ``` 144 | 145 | # Computer ([Docs](https://docs.trycua.com/docs/computer-sdk/computers)) 146 | 147 | ```bash 148 | pip install cua-computer[all] 149 | ``` 150 | ```python 151 | from computer import Computer 152 | 153 | async with Computer( 154 | os_type="linux", 155 | provider_type="cloud", 156 | name="your-sandbox-name", 157 | api_key="your-api-key" 158 | ) as computer: 159 | # Take screenshot 160 | screenshot = await computer.interface.screenshot() 161 | 162 | # Click and type 163 | await computer.interface.left_click(100, 100) 164 | await computer.interface.type("Hello!") 165 | ``` 166 | 167 | # Resources 168 | 169 | - [How to use the MCP Server with Claude Desktop or other MCP clients](./libs/python/mcp-server/README.md) - One of the easiest ways to get started with Cua 170 | - [How to use OpenAI Computer-Use, Anthropic, OmniParser, or UI-TARS for your Computer-Use Agent](./libs/python/agent/README.md) 171 | - [How to use Lume CLI for managing desktops](./libs/lume/README.md) 172 | - [Training Computer-Use Models: Collecting Human Trajectories with Cua (Part 1)](https://www.trycua.com/blog/training-computer-use-models-trajectories-1) 173 | 174 | ## Modules 175 | 176 | | Module | Description | Installation | 177 | |--------|-------------|---------------| 178 | | [**Lume**](./libs/lume/README.md) | VM management for macOS/Linux using Apple's Virtualization.Framework | `curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh \| bash` | 179 | | [**Lumier**](./libs/lumier/README.md) | Docker interface for macOS and Linux VMs | `docker pull trycua/lumier:latest` | 180 | | [**Computer (Python)**](./libs/python/computer/README.md) | Python Interface for controlling virtual machines | `pip install "cua-computer[all]"` | 181 | | [**Computer (Typescript)**](./libs/typescript/computer/README.md) | Typescript Interface for controlling virtual machines | `npm install @trycua/computer` | 182 | | [**Agent**](./libs/python/agent/README.md) | AI agent framework for automating tasks | `pip install "cua-agent[all]"` | 183 | | [**MCP Server**](./libs/python/mcp-server/README.md) | MCP server for using CUA with Claude Desktop | `pip install cua-mcp-server` | 184 | | [**SOM**](./libs/python/som/README.md) | Self-of-Mark library for Agent | `pip install cua-som` | 185 | | [**Computer Server**](./libs/python/computer-server/README.md) | Server component for Computer | `pip install cua-computer-server` | 186 | | [**Core (Python)**](./libs/python/core/README.md) | Python Core utilities | `pip install cua-core` | 187 | | [**Core (Typescript)**](./libs/typescript/core/README.md) | Typescript Core utilities | `npm install @trycua/core` | 188 | 189 | ## Community 190 | 191 | Join our [Discord community](https://discord.com/invite/mVnXXpdE85) to discuss ideas, get assistance, or share your demos! 192 | 193 | ## License 194 | 195 | Cua is open-sourced under the MIT License - see the [LICENSE](LICENSE.md) file for details. 196 | 197 | Portions of this project, specifically components adapted from Kasm Technologies Inc., are also licensed under the MIT License. See [libs/kasm/LICENSE](libs/kasm/LICENSE) for details. 198 | 199 | Microsoft's OmniParser, which is used in this project, is licensed under the Creative Commons Attribution 4.0 International License (CC-BY-4.0). See the [OmniParser LICENSE](https://github.com/microsoft/OmniParser/blob/master/LICENSE) for details. 200 | 201 | ### Third-Party Licenses and Optional Components 202 | 203 | Some optional extras for this project depend on third-party packages that are licensed under terms different from the MIT License. 204 | 205 | - The optional "omni" extra (installed via `pip install "cua-agent[omni]"`) installs the `cua-som` module, which includes `ultralytics` and is licensed under the AGPL-3.0. 206 | 207 | When you choose to install and use such optional extras, your use, modification, and distribution of those third-party components are governed by their respective licenses (e.g., AGPL-3.0 for `ultralytics`). 208 | 209 | ## Contributing 210 | 211 | We welcome contributions to Cua! Please refer to our [Contributing Guidelines](CONTRIBUTING.md) for details. 212 | 213 | ## Trademarks 214 | 215 | Apple, macOS, and Apple Silicon are trademarks of Apple Inc. 216 | Ubuntu and Canonical are registered trademarks of Canonical Ltd. 217 | Microsoft is a registered trademark of Microsoft Corporation. 218 | 219 | This project is not affiliated with, endorsed by, or sponsored by Apple Inc., Canonical Ltd., Microsoft Corporation, or Kasm Technologies. 220 | 221 | ## Stargazers 222 | 223 | Thank you to all our supporters! 224 | 225 | [](https://starchart.cc/trycua/cua) 226 | 227 | ## Sponsors 228 | 229 | Thank you to all our [GitHub Sponsors](https://github.com/sponsors/trycua)! 230 | 231 | <img width="300" alt="coderabbit-cli" src="https://github.com/user-attachments/assets/23a98e38-7897-4043-8ef7-eb990520dccc" /> 232 | ``` -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- ```markdown 1 | MIT License 2 | 3 | Copyright (c) 2025 Cua AI, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. ``` -------------------------------------------------------------------------------- /libs/lume/CONTRIBUTING.md: -------------------------------------------------------------------------------- ```markdown 1 | # Contributing to lume 2 | 3 | We deeply appreciate your interest in contributing to lume! Whether you're reporting bugs, suggesting enhancements, improving docs, or submitting pull requests, your contributions help improve the project for everyone. 4 | 5 | ## Reporting Bugs 6 | 7 | If you've encountered a bug in the project, we encourage you to report it. Please follow these steps: 8 | 9 | 1. **Check the Issue Tracker**: Before submitting a new bug report, please check our issue tracker to see if the bug has already been reported. 10 | 2. **Create a New Issue**: If the bug hasn't been reported, create a new issue with: 11 | - A clear title and detailed description 12 | - Steps to reproduce the issue 13 | - Expected vs actual behavior 14 | - Your environment (macOS version, lume version) 15 | - Any relevant logs or error messages 16 | 3. **Label Your Issue**: Label your issue as a `bug` to help maintainers identify it quickly. 17 | 18 | ## Suggesting Enhancements 19 | 20 | We're always looking for suggestions to make lume better. If you have an idea: 21 | 22 | 1. **Check Existing Issues**: See if someone else has already suggested something similar. 23 | 2. **Create a New Issue**: If your enhancement is new, create an issue describing: 24 | - The problem your enhancement solves 25 | - How your enhancement would work 26 | - Any potential implementation details 27 | - Why this enhancement would benefit lume users 28 | 29 | ## Documentation 30 | 31 | Documentation improvements are always welcome. You can: 32 | - Fix typos or unclear explanations 33 | - Add examples and use cases 34 | - Improve API documentation 35 | - Add tutorials or guides 36 | 37 | For detailed instructions on setting up your development environment and submitting code contributions, please see our [Development.md](docs/Development.md) guide. 38 | 39 | Feel free to join our [Discord community](https://discord.com/invite/mVnXXpdE85) to discuss ideas or get help with your contributions. ``` -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- ```markdown 1 | # Contributing to cua 2 | 3 | We deeply appreciate your interest in contributing to cua! Whether you're reporting bugs, suggesting enhancements, improving docs, or submitting pull requests, your contributions help improve the project for everyone. 4 | 5 | ## Reporting Bugs 6 | 7 | If you've encountered a bug in the project, we encourage you to report it. Please follow these steps: 8 | 9 | 1. **Check the Issue Tracker**: Before submitting a new bug report, please check our issue tracker to see if the bug has already been reported. 10 | 2. **Create a New Issue**: If the bug hasn't been reported, create a new issue with: 11 | - A clear title and detailed description 12 | - Steps to reproduce the issue 13 | - Expected vs actual behavior 14 | - Your environment (macOS version, lume version) 15 | - Any relevant logs or error messages 16 | 3. **Label Your Issue**: Label your issue as a `bug` to help maintainers identify it quickly. 17 | 18 | ## Suggesting Enhancements 19 | 20 | We're always looking for suggestions to make lume better. If you have an idea: 21 | 22 | 1. **Check Existing Issues**: See if someone else has already suggested something similar. 23 | 2. **Create a New Issue**: If your enhancement is new, create an issue describing: 24 | - The problem your enhancement solves 25 | - How your enhancement would work 26 | - Any potential implementation details 27 | - Why this enhancement would benefit lume users 28 | 29 | ## Code Formatting 30 | 31 | We follow strict code formatting guidelines to ensure consistency across the codebase. Before submitting any code: 32 | 33 | 1. **Review Our Format Guide**: Please review our [Code Formatting Standards](Development.md#code-formatting-standards) section in the Getting Started guide. 34 | 2. **Configure Your IDE**: We recommend using the workspace settings provided in `.vscode/` for automatic formatting. 35 | 3. **Run Formatting Tools**: Always run the formatting tools before submitting a PR: 36 | ```bash 37 | # For Python code 38 | pdm run black . 39 | pdm run ruff check --fix . 40 | ``` 41 | 4. **Validate Your Code**: Ensure your code passes all checks: 42 | ```bash 43 | pdm run mypy . 44 | ``` 45 | 46 | ## Documentation 47 | 48 | Documentation improvements are always welcome. You can: 49 | - Fix typos or unclear explanations 50 | - Add examples and use cases 51 | - Improve API documentation 52 | - Add tutorials or guides 53 | 54 | For detailed instructions on setting up your development environment and submitting code contributions, please see our [Developer-Guide](Development.md). 55 | 56 | Feel free to join our [Discord community](https://discord.com/invite/mVnXXpdE85) to discuss ideas or get help with your contributions. ``` -------------------------------------------------------------------------------- /libs/python/computer-server/computer_server/diorama/__init__.py: -------------------------------------------------------------------------------- ```python 1 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/src/telemetry/clients/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './posthog'; 2 | ``` -------------------------------------------------------------------------------- /libs/python/computer/poetry.toml: -------------------------------------------------------------------------------- ```toml 1 | [virtualenvs] 2 | in-project = true 3 | ``` -------------------------------------------------------------------------------- /libs/python/core/poetry.toml: -------------------------------------------------------------------------------- ```toml 1 | [virtualenvs] 2 | in-project = true ``` -------------------------------------------------------------------------------- /libs/python/som/poetry.toml: -------------------------------------------------------------------------------- ```toml 1 | [virtualenvs] 2 | in-project = true 3 | ``` -------------------------------------------------------------------------------- /.github/scripts/tests/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Tests for .github/scripts.""" 2 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/ui/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """UI modules for the Computer Interface.""" 2 | ``` -------------------------------------------------------------------------------- /libs/typescript/pnpm-workspace.yaml: -------------------------------------------------------------------------------- ```yaml 1 | packages: 2 | - "computer" 3 | - "core" 4 | - "agent" 5 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/computer/providers/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './base'; 2 | export * from './cloud'; 3 | ``` -------------------------------------------------------------------------------- /docs/content/docs/agent-sdk/integrations/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "title": "Integrations", 3 | "pages": ["hud"] 4 | } 5 | ``` -------------------------------------------------------------------------------- /libs/python/computer-server/examples/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Examples package for the CUA Computer API. 3 | """ 4 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/computer/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export { BaseComputer, CloudComputer } from './providers'; 2 | ``` -------------------------------------------------------------------------------- /libs/python/agent/benchmarks/models/__init__.py: -------------------------------------------------------------------------------- ```python 1 | from .base import ModelProtocol 2 | 3 | __all__ = ["ModelProtocol"] 4 | ``` -------------------------------------------------------------------------------- /tests/pytest.ini: -------------------------------------------------------------------------------- ``` 1 | [pytest] 2 | asyncio_mode = auto 3 | markers = 4 | asyncio: asyncio mark ``` -------------------------------------------------------------------------------- /docs/postcss.config.mjs: -------------------------------------------------------------------------------- ``` 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | }, 5 | }; 6 | ``` -------------------------------------------------------------------------------- /libs/python/agent/agent/ui/__main__.py: -------------------------------------------------------------------------------- ```python 1 | from .gradio import launch_ui 2 | 3 | if __name__ == "__main__": 4 | launch_ui() ``` -------------------------------------------------------------------------------- /libs/python/core/core/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Core functionality shared across Cua components.""" 2 | 3 | __version__ = "0.1.8" 4 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/vitest.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({}); 4 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/lumier/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "pages": [ 3 | "installation", 4 | "docker", 5 | "docker-compose", 6 | "building-lumier" 7 | ] 8 | } 9 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/lume/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "pages": [ 3 | "installation", 4 | "prebuilt-images", 5 | "cli-reference", 6 | "http-api", 7 | "faq" 8 | ] 9 | } 10 | ``` -------------------------------------------------------------------------------- /docs/src/app/global.css: -------------------------------------------------------------------------------- ```css 1 | @import 'tailwindcss'; 2 | @import 'fumadocs-ui/css/neutral.css'; 3 | @import 'fumadocs-ui/css/preset.css'; 4 | ``` -------------------------------------------------------------------------------- /libs/lume/src/Commands/Options/FormatOption.swift: -------------------------------------------------------------------------------- ```swift 1 | import ArgumentParser 2 | 3 | enum FormatOption: String, ExpressibleByArgument { 4 | case json 5 | case text 6 | } 7 | ``` -------------------------------------------------------------------------------- /libs/lume/src/ContainerRegistry/ImageList.swift: -------------------------------------------------------------------------------- ```swift 1 | public struct ImageList: Codable { 2 | public let local: [String] 3 | public let remote: [String] 4 | } ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/ui/gradio/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Gradio UI for Computer UI.""" 2 | 3 | import gradio as gr 4 | from typing import Optional 5 | 6 | from .app import create_gradio_ui 7 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/tests/setup.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { afterAll, afterEach, beforeAll } from 'vitest'; 2 | 3 | beforeAll(() => {}); 4 | 5 | afterAll(() => {}); 6 | 7 | afterEach(() => {}); 8 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/mcp-server/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "pages": [ 3 | "installation", 4 | "configuration", 5 | "usage", 6 | "tools", 7 | "client-integrations", 8 | "llm-integrations" 9 | ] 10 | } ``` -------------------------------------------------------------------------------- /libs/typescript/agent/vitest.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { defineConfig } from 'vitest/config' 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'happy-dom', 6 | }, 7 | }) 8 | ``` -------------------------------------------------------------------------------- /libs/python/agent/agent/ui/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | UI components for agent 3 | """ 4 | 5 | from .gradio import launch_ui, create_gradio_ui 6 | 7 | __all__ = ["launch_ui", "create_gradio_ui"] 8 | ``` -------------------------------------------------------------------------------- /libs/python/mcp-server/mcp_server/__main__.py: -------------------------------------------------------------------------------- ```python 1 | #!/usr/bin/env python 2 | """Entry point for the MCP server module.""" 3 | 4 | from .server import main 5 | 6 | if __name__ == "__main__": 7 | main() 8 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/providers/cloud/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """CloudProvider module for interacting with cloud-based virtual machines.""" 2 | 3 | from .provider import CloudProvider 4 | 5 | __all__ = ["CloudProvider"] 6 | ``` -------------------------------------------------------------------------------- /libs/python/agent/agent/ui/gradio/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Gradio UI for agent 3 | """ 4 | 5 | from .app import launch_ui 6 | from .ui_components import create_gradio_ui 7 | 8 | __all__ = ["launch_ui", "create_gradio_ui"] 9 | ``` -------------------------------------------------------------------------------- /docs/content/docs/agent-sdk/benchmarks/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "pages": [ 3 | "introduction", 4 | "screenspot-v2", 5 | "screenspot-pro", 6 | "interactive", 7 | "osworld-verified" 8 | ] 9 | } ``` -------------------------------------------------------------------------------- /libs/typescript/core/tsdown.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { defineConfig } from 'tsdown'; 2 | 3 | export default defineConfig([ 4 | { 5 | entry: ['./src/index.ts'], 6 | platform: 'node', 7 | dts: true, 8 | }, 9 | ]); 10 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/types.ts: -------------------------------------------------------------------------------- ```typescript 1 | export enum OSType { 2 | MACOS = 'macos', 3 | WINDOWS = 'windows', 4 | LINUX = 'linux', 5 | } 6 | 7 | export interface ScreenSize { 8 | width: number; 9 | height: number; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/src/app/api/search/route.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { source } from '@/lib/source'; 2 | import { createFromSource } from 'fumadocs-core/search/server'; 3 | 4 | export const { GET } = createFromSource(source); 5 | ``` -------------------------------------------------------------------------------- /libs/lume/src/Utils/String.swift: -------------------------------------------------------------------------------- ```swift 1 | import Foundation 2 | 3 | extension String { 4 | func padding(_ toLength: Int) -> String { 5 | return self.padding(toLength: toLength, withPad: " ", startingAt: 0) 6 | } 7 | } 8 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | // Export classes 2 | export { CloudComputer as Computer } from './computer'; 3 | 4 | //todo: figure out what types to export and how to do that 5 | // 6 | export { OSType } from './types'; 7 | ``` -------------------------------------------------------------------------------- /libs/lume/src/Utils/CommandUtils.swift: -------------------------------------------------------------------------------- ```swift 1 | import ArgumentParser 2 | import Foundation 3 | 4 | func completeVMName(_ arguments: [String]) -> [String] { 5 | (try? Home().getAllVMDirectories().map { $0.directory.name }) ?? [] 6 | } 7 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/vitest.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | setupFiles: ['./tests/setup.ts'], 6 | environment: 'node', 7 | globals: true, 8 | }, 9 | }); 10 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * This module provides the core telemetry functionality for CUA libraries. 3 | * 4 | * It provides a low-overhead way to collect anonymous usage data. 5 | */ 6 | 7 | export * from './telemetry'; 8 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/tsdown.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { defineConfig } from 'tsdown'; 2 | 3 | export default defineConfig([ 4 | { 5 | entry: ['./src/index.ts'], 6 | platform: 'node', 7 | dts: true, 8 | external: ['child_process', 'util'], 9 | }, 10 | ]); 11 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/providers/lume/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Lume VM provider implementation.""" 2 | 3 | try: 4 | from .provider import LumeProvider 5 | HAS_LUME = True 6 | __all__ = ["LumeProvider"] 7 | except ImportError: 8 | HAS_LUME = False 9 | __all__ = [] 10 | ``` -------------------------------------------------------------------------------- /libs/python/pylume/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | PyLume Python SDK - A client library for managing macOS VMs with PyLume. 3 | """ 4 | 5 | from pylume.pylume import * 6 | from pylume.models import * 7 | from pylume.exceptions import * 8 | 9 | __version__ = "0.1.0" 10 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/providers/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Provider implementations for different VM backends.""" 2 | 3 | # Import specific providers only when needed to avoid circular imports 4 | __all__ = [] # Let each provider module handle its own exports 5 | ``` -------------------------------------------------------------------------------- /docs/content/docs/computer-sdk/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "title": "Computer SDK", 3 | "description": "Build computer-using agents with the Computer SDK", 4 | "pages": [ 5 | "computers", 6 | "commands", 7 | "computer-ui", 8 | "sandboxed-python" 9 | ] 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/content/docs/agent-sdk/callbacks/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "title": "Callbacks", 3 | "description": "Extending agents with callback hooks and built-in handlers", 4 | "pages": [ 5 | "agent-lifecycle", 6 | "trajectories", 7 | "logging", 8 | "cost-saving", 9 | "pii-anonymization" 10 | ] 11 | } 12 | ``` -------------------------------------------------------------------------------- /docs/content/docs/agent-sdk/supported-agents/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "title": "Supported Agents", 3 | "description": "Models and configurations supported by the Agent SDK", 4 | "pages": [ 5 | "computer-use-agents", 6 | "grounding-models", 7 | "composed-agents", 8 | "human-in-the-loop" 9 | ] 10 | } 11 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/providers/lumier/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Lumier VM provider implementation.""" 2 | 3 | try: 4 | # Use the same import approach as in the Lume provider 5 | from .provider import LumierProvider 6 | HAS_LUMIER = True 7 | except ImportError: 8 | HAS_LUMIER = False 9 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/src/telemetry/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * This module provides the core telemetry functionality for CUA libraries. 3 | * 4 | * It provides a low-overhead way to collect anonymous usage data. 5 | */ 6 | 7 | export { PostHogTelemetryClient as Telemetry } from './clients'; 8 | ``` -------------------------------------------------------------------------------- /libs/python/computer-server/computer_server/__main__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Main entry point for running the Computer Server as a module. 3 | This allows the server to be started with `python -m computer_server`. 4 | """ 5 | 6 | import sys 7 | from .cli import main 8 | 9 | if __name__ == "__main__": 10 | sys.exit(main()) 11 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/mcp-server/tools.mdx: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: Tools 3 | --- 4 | 5 | ## Available Tools 6 | 7 | The MCP server exposes the following tools to Claude: 8 | 9 | 1. `run_cua_task` - Run a single Computer-Use Agent task with the given instruction 10 | 2. `run_multi_cua_tasks` - Run multiple tasks in sequence ``` -------------------------------------------------------------------------------- /libs/python/computer-server/computer_server/diorama/base.py: -------------------------------------------------------------------------------- ```python 1 | class BaseDioramaHandler: 2 | """Base Diorama handler for unsupported OSes.""" 3 | async def diorama_cmd(self, action: str, arguments: dict = None) -> dict: 4 | return {"success": False, "error": "Diorama is not supported on this OS yet."} 5 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/providers/winsandbox/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Windows Sandbox provider for CUA Computer.""" 2 | 3 | try: 4 | import winsandbox 5 | HAS_WINSANDBOX = True 6 | except ImportError: 7 | HAS_WINSANDBOX = False 8 | 9 | from .provider import WinSandboxProvider 10 | 11 | __all__ = ["WinSandboxProvider", "HAS_WINSANDBOX"] 12 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/interface/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Interface package for Computer SDK. 3 | """ 4 | 5 | from .factory import InterfaceFactory 6 | from .base import BaseComputerInterface 7 | from .macos import MacOSComputerInterface 8 | 9 | __all__ = [ 10 | "InterfaceFactory", 11 | "BaseComputerInterface", 12 | "MacOSComputerInterface", 13 | ] ``` -------------------------------------------------------------------------------- /docs/content/docs/agent-sdk/benchmarks/osworld-verified.mdx: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: OSWorld-Verified 3 | description: Benchmark ComputerAgent on OSWorld tasks using HUD 4 | --- 5 | 6 | OSWorld-Verified is a curated subset of OSWorld tasks that can be run using the HUD framework. 7 | 8 | Use [ComputerAgent with HUD](../integrations/hud) to benchmark on these tasks. ``` -------------------------------------------------------------------------------- /libs/xfce/src/scripts/start-computer-server.sh: -------------------------------------------------------------------------------- ```bash 1 | #!/bin/bash 2 | set -e 3 | 4 | # Wait for X server to be ready 5 | echo "Waiting for X server to start..." 6 | while ! xdpyinfo -display :1 >/dev/null 2>&1; do 7 | sleep 1 8 | done 9 | echo "X server is ready" 10 | 11 | # Start computer-server 12 | export DISPLAY=:1 13 | python3 -m computer_server --port ${API_PORT:-8000} 14 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/ui/__main__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Main entry point for computer.ui module. 3 | 4 | This allows running the computer UI with: 5 | python -m computer.ui 6 | 7 | Instead of: 8 | python -m computer.ui.gradio.app 9 | """ 10 | 11 | from .gradio.app import create_gradio_ui 12 | 13 | if __name__ == "__main__": 14 | app = create_gradio_ui() 15 | app.launch() 16 | ``` -------------------------------------------------------------------------------- /libs/xfce/src/scripts/start-novnc.sh: -------------------------------------------------------------------------------- ```bash 1 | #!/bin/bash 2 | set -e 3 | 4 | # Give VNC a moment to start (supervisor starts it with priority 10, this is priority 20) 5 | echo "Waiting for VNC server to start..." 6 | sleep 5 7 | 8 | # Start noVNC 9 | cd /opt/noVNC 10 | /opt/noVNC/utils/novnc_proxy \ 11 | --vnc localhost:${VNC_PORT:-5901} \ 12 | --listen ${NOVNC_PORT:-6901} 13 | ``` -------------------------------------------------------------------------------- /libs/python/agent/agent/adapters/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Adapters package for agent - Custom LLM adapters for LiteLLM 3 | """ 4 | 5 | from .huggingfacelocal_adapter import HuggingFaceLocalAdapter 6 | from .human_adapter import HumanAdapter 7 | from .mlxvlm_adapter import MLXVLMAdapter 8 | 9 | __all__ = [ 10 | "HuggingFaceLocalAdapter", 11 | "HumanAdapter", 12 | "MLXVLMAdapter", 13 | ] 14 | ``` -------------------------------------------------------------------------------- /docs/src/app/llms.txt/route.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { source } from '@/lib/source'; 2 | import { getLLMText } from '@/lib/llms'; 3 | 4 | // cached forever 5 | export const revalidate = false; 6 | 7 | export async function GET() { 8 | const scan = source.getPages().map(getLLMText); 9 | const scanned = await Promise.all(scan); 10 | 11 | return new Response(scanned.join('\n\n')); 12 | } 13 | ``` -------------------------------------------------------------------------------- /libs/xfce/src/scripts/xstartup.sh: -------------------------------------------------------------------------------- ```bash 1 | #!/bin/bash 2 | set -e 3 | 4 | # Start D-Bus 5 | if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then 6 | eval $(dbus-launch --sh-syntax --exit-with-session) 7 | fi 8 | 9 | # Start XFCE 10 | startxfce4 & 11 | 12 | # Wait for XFCE to start 13 | sleep 2 14 | 15 | # Disable screensaver and power management 16 | xset s off 17 | xset -dpms 18 | xset s noblank 19 | 20 | # Wait for the session 21 | wait 22 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/interface/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export { BaseComputerInterface } from './base'; 2 | export type { MouseButton, CursorPosition, AccessibilityNode } from './base'; 3 | export { InterfaceFactory } from './factory'; 4 | export { MacOSComputerInterface } from './macos'; 5 | export { LinuxComputerInterface } from './linux'; 6 | export { WindowsComputerInterface } from './windows'; 7 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/mcp-server/index.mdx: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: MCP Server 3 | description: Reference for the current version of the MCP Server library. 4 | pypi: cua-mcp-server 5 | github: 6 | - https://github.com/trycua/cua/tree/main/libs/python/mcp-server 7 | --- 8 | 9 | **cua-mcp-server** is a MCP server for the Computer-Use Agent (CUA), allowing you to run CUA through Claude Desktop or other MCP clients. ``` -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "name": "Cua - OSS", 3 | "build": { 4 | "dockerfile": "../Dockerfile" 5 | }, 6 | "containerEnv": { 7 | "DISPLAY": "", 8 | "PYLUME_HOST": "host.docker.internal" 9 | }, 10 | "forwardPorts": [7860], 11 | "portsAttributes": { 12 | "7860": { 13 | "label": "Cua web client (Gradio)", 14 | "onAutoForward": "silent" 15 | } 16 | }, 17 | "postCreateCommand": "/bin/bash .devcontainer/post-install.sh" 18 | } 19 | ``` -------------------------------------------------------------------------------- /libs/python/core/core/telemetry/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """This module provides the core telemetry functionality for CUA libraries. 2 | 3 | It provides a low-overhead way to collect anonymous usage data. 4 | """ 5 | 6 | from core.telemetry.posthog import ( 7 | record_event, 8 | is_telemetry_enabled, 9 | destroy_telemetry_client, 10 | ) 11 | 12 | 13 | __all__ = [ 14 | "record_event", 15 | "is_telemetry_enabled", 16 | "destroy_telemetry_client", 17 | ] 18 | ``` -------------------------------------------------------------------------------- /libs/typescript/agent/tsdown.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { defineConfig } from "tsdown"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | format: ["module"], 6 | platform: "browser", 7 | dts: true, 8 | clean: true, 9 | // Remove if we don't need to support including the library via '<script/>' tags. 10 | // noExternal bundles this list of libraries within the final 'dist' 11 | noExternal: ['peerjs'] 12 | }); 13 | ``` -------------------------------------------------------------------------------- /docs/content/docs/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "title": "Home", 3 | "description": "Documentation Home", 4 | "root": true, 5 | "defaultOpen": true, 6 | "pages": [ 7 | "index", 8 | "quickstart-devs", 9 | "quickstart-cli", 10 | "telemetry", 11 | "---[BookCopy]Computer Playbook---", 12 | "...computer-sdk", 13 | "---[BookCopy]Agent Playbook---", 14 | "...agent-sdk", 15 | "---[CodeXml]API Reference---", 16 | "...libraries" 17 | ] 18 | } ``` -------------------------------------------------------------------------------- /docs/src/app/(home)/layout.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { baseOptions } from '@/app/layout.config'; 2 | import { source } from '@/lib/source'; 3 | import { DocsLayout } from 'fumadocs-ui/layouts/docs'; 4 | import type { ReactNode } from 'react'; 5 | 6 | export default function Layout({ children }: { children: ReactNode }) { 7 | return ( 8 | <DocsLayout tree={source.pageTree} {...baseOptions}> 9 | {children} 10 | </DocsLayout> 11 | ); 12 | } 13 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/core/index.mdx: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: Core 3 | description: Reference for the current version of the Core library. 4 | pypi: cua-core 5 | npm: '@trycua/core' 6 | github: 7 | - https://github.com/trycua/cua/tree/main/libs/python/core 8 | - https://github.com/trycua/cua/tree/main/libs/typescript/core 9 | --- 10 | 11 | ## Overview 12 | 13 | The Core library provides foundational utilities and shared functionality across the CUA ecosystem. 14 | ``` -------------------------------------------------------------------------------- /libs/python/computer-server/computer_server/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """ 2 | Computer API package. 3 | Provides a server interface for the Computer API. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | __version__: str = "0.1.0" 9 | 10 | # Explicitly export Server for static type checkers 11 | from .server import Server as Server # noqa: F401 12 | 13 | __all__ = ["Server", "run_cli"] 14 | 15 | 16 | def run_cli() -> None: 17 | """Entry point for CLI""" 18 | from .cli import main 19 | 20 | main() 21 | ``` -------------------------------------------------------------------------------- /libs/python/computer-server/run_server.py: -------------------------------------------------------------------------------- ```python 1 | #!/usr/bin/env python 2 | """ 3 | Entrypoint script for the Computer Server. 4 | 5 | This script provides a simple way to start the Computer Server from the command line 6 | or using a launch configuration in an IDE. 7 | 8 | Usage: 9 | python run_server.py [--host HOST] [--port PORT] [--log-level LEVEL] 10 | """ 11 | 12 | import sys 13 | from computer_server.cli import main 14 | 15 | if __name__ == "__main__": 16 | sys.exit(main()) 17 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/tests/computer/cloud.test.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { describe, expect, it } from 'vitest'; 2 | import { Computer } from '../../src'; 3 | import { OSType } from '../../src/types'; 4 | 5 | describe('Computer Cloud', () => { 6 | it('Should create computer instance', () => { 7 | const cloud = new Computer({ 8 | apiKey: 'asdf', 9 | name: 's-linux-1234', 10 | osType: OSType.LINUX, 11 | }); 12 | expect(cloud).toBeInstanceOf(Computer); 13 | }); 14 | }); 15 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/providers/docker/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """Docker provider for running containers with computer-server.""" 2 | 3 | from .provider import DockerProvider 4 | 5 | # Check if Docker is available 6 | try: 7 | import subprocess 8 | subprocess.run(["docker", "--version"], capture_output=True, check=True) 9 | HAS_DOCKER = True 10 | except (subprocess.SubprocessError, FileNotFoundError): 11 | HAS_DOCKER = False 12 | 13 | __all__ = ["DockerProvider", "HAS_DOCKER"] 14 | ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/interface/linux.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * Linux computer interface implementation. 3 | */ 4 | 5 | import { MacOSComputerInterface } from './macos'; 6 | 7 | /** 8 | * Linux interface implementation. 9 | * Since the cloud provider uses the same WebSocket protocol for all OS types, 10 | * we can reuse the macOS implementation. 11 | */ 12 | export class LinuxComputerInterface extends MacOSComputerInterface { 13 | // Linux uses the same WebSocket interface as macOS for cloud provider 14 | } 15 | ``` -------------------------------------------------------------------------------- /libs/python/som/som/__init__.py: -------------------------------------------------------------------------------- ```python 1 | """SOM - Computer Vision and OCR library for detecting and analyzing UI elements.""" 2 | 3 | __version__ = "0.1.0" 4 | 5 | from .detect import OmniParser 6 | from .models import ( 7 | BoundingBox, 8 | UIElement, 9 | IconElement, 10 | TextElement, 11 | ParserMetadata, 12 | ParseResult 13 | ) 14 | 15 | __all__ = [ 16 | "OmniParser", 17 | "BoundingBox", 18 | "UIElement", 19 | "IconElement", 20 | "TextElement", 21 | "ParserMetadata", 22 | "ParseResult" 23 | ] ``` -------------------------------------------------------------------------------- /libs/python/som/tests/test_omniparser.py: -------------------------------------------------------------------------------- ```python 1 | # """Basic tests for the omniparser package.""" 2 | 3 | # import pytest 4 | # from omniparser import IconDetector 5 | 6 | # def test_icon_detector_import(): 7 | # """Test that we can import the IconDetector class.""" 8 | # assert IconDetector is not None 9 | 10 | # def test_icon_detector_init(): 11 | # """Test that we can create an IconDetector instance.""" 12 | # detector = IconDetector(force_cpu=True) 13 | # assert detector is not None 14 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/interface/linux.py: -------------------------------------------------------------------------------- ```python 1 | from typing import Optional 2 | from .generic import GenericComputerInterface 3 | 4 | class LinuxComputerInterface(GenericComputerInterface): 5 | """Interface for Linux.""" 6 | 7 | def __init__(self, ip_address: str, username: str = "lume", password: str = "lume", api_key: Optional[str] = None, vm_name: Optional[str] = None): 8 | super().__init__(ip_address, username, password, api_key, vm_name, "computer.interface.linux") 9 | ``` -------------------------------------------------------------------------------- /libs/lume/src/Utils/ProcessRunner.swift: -------------------------------------------------------------------------------- ```swift 1 | import Foundation 2 | 3 | /// Protocol for process execution 4 | protocol ProcessRunner { 5 | func run(executable: String, arguments: [String]) throws 6 | } 7 | 8 | class DefaultProcessRunner: ProcessRunner { 9 | func run(executable: String, arguments: [String]) throws { 10 | let process = Process() 11 | process.executableURL = URL(fileURLWithPath: executable) 12 | process.arguments = arguments 13 | try process.run() 14 | } 15 | } ``` -------------------------------------------------------------------------------- /libs/typescript/computer/src/interface/windows.ts: -------------------------------------------------------------------------------- ```typescript 1 | /** 2 | * Windows computer interface implementation. 3 | */ 4 | 5 | import { MacOSComputerInterface } from './macos'; 6 | 7 | /** 8 | * Windows interface implementation. 9 | * Since the cloud provider uses the same WebSocket protocol for all OS types, 10 | * we can reuse the macOS implementation. 11 | */ 12 | export class WindowsComputerInterface extends MacOSComputerInterface { 13 | // Windows uses the same WebSocket interface as macOS for cloud provider 14 | } 15 | ``` -------------------------------------------------------------------------------- /libs/python/computer/computer/interface/windows.py: -------------------------------------------------------------------------------- ```python 1 | from typing import Optional 2 | from .generic import GenericComputerInterface 3 | 4 | class WindowsComputerInterface(GenericComputerInterface): 5 | """Interface for Windows.""" 6 | 7 | def __init__(self, ip_address: str, username: str = "lume", password: str = "lume", api_key: Optional[str] = None, vm_name: Optional[str] = None): 8 | super().__init__(ip_address, username, password, api_key, vm_name, "computer.interface.windows") 9 | ``` -------------------------------------------------------------------------------- /docs/content/docs/libraries/lume/index.mdx: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: Lume 3 | description: Reference for the current version of the Lume CLI. 4 | github: 5 | - https://github.com/trycua/cua/tree/main/libs/lume 6 | --- 7 | 8 | Lume is a lightweight Command Line Interface and local API server for creating, running and managing **macOS and Linux virtual machines** with near-native performance on Apple Silicon, using Apple's [Virtualization.Framework](https://developer.apple.com/documentation/virtualization). ``` -------------------------------------------------------------------------------- /docs/content/docs/agent-sdk/meta.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "title": "Agent SDK", 3 | "description": "Build computer-using agents with the Agent SDK", 4 | "pages": [ 5 | "agent-loops", 6 | "supported-agents", 7 | "supported-model-providers", 8 | "chat-history", 9 | "message-format", 10 | "customizing-computeragent", 11 | "callbacks", 12 | "custom-tools", 13 | "custom-computer-handlers", 14 | "prompt-caching", 15 | "usage-tracking", 16 | "benchmarks", 17 | "migration-guide", 18 | "integrations" 19 | ] 20 | } 21 | ``` -------------------------------------------------------------------------------- /libs/lume/src/Commands/Prune.swift: -------------------------------------------------------------------------------- ```swift 1 | import ArgumentParser 2 | import Foundation 3 | 4 | struct Prune: AsyncParsableCommand { 5 | static let configuration: CommandConfiguration = CommandConfiguration( 6 | commandName: "prune", 7 | abstract: "Remove cached images" 8 | ) 9 | 10 | init() { 11 | } 12 | 13 | @MainActor 14 | func run() async throws { 15 | let manager = LumeController() 16 | try await manager.pruneImages() 17 | print("Successfully removed cached images") 18 | } 19 | } ``` -------------------------------------------------------------------------------- /pyrightconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "include": [ 3 | "**/*.py" 4 | ], 5 | "exclude": [ 6 | "**/node_modules/**", 7 | "**/__pycache__/**", 8 | "**/.*/**", 9 | "**/venv/**", 10 | "**/.venv/**", 11 | "**/dist/**", 12 | "**/build/**", 13 | ".pdm-build/**", 14 | "**/.git/**", 15 | "examples/**", 16 | "notebooks/**", 17 | "logs/**", 18 | "screenshots/**" 19 | ], 20 | "typeCheckingMode": "basic", 21 | "useLibraryCodeForTypes": true, 22 | "reportMissingImports": false, 23 | "reportMissingModuleSource": false 24 | } 25 | ``` -------------------------------------------------------------------------------- /libs/typescript/core/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "lib": ["es2023"], 5 | "moduleDetection": "force", 6 | "module": "preserve", 7 | "moduleResolution": "bundler", 8 | "resolveJsonModule": true, 9 | "types": ["node"], 10 | "strict": true, 11 | "noUnusedLocals": true, 12 | "declaration": true, 13 | "emitDeclarationOnly": true, 14 | "esModuleInterop": true, 15 | "isolatedModules": true, 16 | "verbatimModuleSyntax": true, 17 | "skipLibCheck": true 18 | }, 19 | "include": ["src"] 20 | } 21 | ``` -------------------------------------------------------------------------------- /libs/lumier/src/config/constants.sh: -------------------------------------------------------------------------------- ```bash 1 | #!/usr/bin/env bash 2 | 3 | # Port configuration 4 | TUNNEL_PORT=8080 5 | VNC_PORT=8006 6 | 7 | # Host configuration 8 | TUNNEL_HOST="host.docker.internal" 9 | 10 | # Default VM configuration 11 | DEFAULT_RAM_SIZE="8192" 12 | DEFAULT_CPU_CORES="4" 13 | DEFAULT_DISK_SIZE="100" 14 | DEFAULT_VM_NAME="lumier" 15 | DEFAULT_VM_VERSION="ghcr.io/trycua/macos-sequoia-vanilla:latest" 16 | 17 | # Paths 18 | NOVNC_PATH="/opt/noVNC" 19 | LIFECYCLE_HOOKS_DIR="/run/hooks" 20 | 21 | # VM connection details 22 | HOST_USER="lume" 23 | HOST_PASSWORD="lume" 24 | SSH_RETRY_ATTEMPTS=20 25 | SSH_RETRY_INTERVAL=5 ```