cua-agent 0.4.22__py3-none-any.whl → 0.7.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (79) hide show
  1. agent/__init__.py +4 -10
  2. agent/__main__.py +2 -1
  3. agent/adapters/__init__.py +4 -0
  4. agent/adapters/azure_ml_adapter.py +283 -0
  5. agent/adapters/cua_adapter.py +161 -0
  6. agent/adapters/huggingfacelocal_adapter.py +67 -125
  7. agent/adapters/human_adapter.py +116 -114
  8. agent/adapters/mlxvlm_adapter.py +110 -99
  9. agent/adapters/models/__init__.py +41 -0
  10. agent/adapters/models/generic.py +78 -0
  11. agent/adapters/models/internvl.py +290 -0
  12. agent/adapters/models/opencua.py +115 -0
  13. agent/adapters/models/qwen2_5_vl.py +78 -0
  14. agent/agent.py +337 -185
  15. agent/callbacks/__init__.py +9 -4
  16. agent/callbacks/base.py +45 -31
  17. agent/callbacks/budget_manager.py +22 -10
  18. agent/callbacks/image_retention.py +54 -98
  19. agent/callbacks/logging.py +55 -42
  20. agent/callbacks/operator_validator.py +35 -33
  21. agent/callbacks/otel.py +291 -0
  22. agent/callbacks/pii_anonymization.py +19 -16
  23. agent/callbacks/prompt_instructions.py +47 -0
  24. agent/callbacks/telemetry.py +99 -61
  25. agent/callbacks/trajectory_saver.py +95 -69
  26. agent/cli.py +269 -119
  27. agent/computers/__init__.py +14 -9
  28. agent/computers/base.py +32 -19
  29. agent/computers/cua.py +52 -25
  30. agent/computers/custom.py +78 -71
  31. agent/decorators.py +23 -14
  32. agent/human_tool/__init__.py +2 -7
  33. agent/human_tool/__main__.py +6 -2
  34. agent/human_tool/server.py +48 -37
  35. agent/human_tool/ui.py +359 -235
  36. agent/integrations/hud/__init__.py +38 -99
  37. agent/integrations/hud/agent.py +369 -0
  38. agent/integrations/hud/proxy.py +166 -52
  39. agent/loops/__init__.py +44 -14
  40. agent/loops/anthropic.py +579 -492
  41. agent/loops/base.py +19 -15
  42. agent/loops/composed_grounded.py +136 -150
  43. agent/loops/fara/__init__.py +8 -0
  44. agent/loops/fara/config.py +506 -0
  45. agent/loops/fara/helpers.py +357 -0
  46. agent/loops/fara/schema.py +143 -0
  47. agent/loops/gelato.py +183 -0
  48. agent/loops/gemini.py +935 -0
  49. agent/loops/generic_vlm.py +601 -0
  50. agent/loops/glm45v.py +140 -135
  51. agent/loops/gta1.py +48 -51
  52. agent/loops/holo.py +218 -0
  53. agent/loops/internvl.py +180 -0
  54. agent/loops/moondream3.py +493 -0
  55. agent/loops/omniparser.py +326 -226
  56. agent/loops/openai.py +50 -51
  57. agent/loops/opencua.py +134 -0
  58. agent/loops/uiins.py +175 -0
  59. agent/loops/uitars.py +247 -206
  60. agent/loops/uitars2.py +951 -0
  61. agent/playground/__init__.py +5 -0
  62. agent/playground/server.py +301 -0
  63. agent/proxy/examples.py +61 -57
  64. agent/proxy/handlers.py +46 -39
  65. agent/responses.py +447 -347
  66. agent/tools/__init__.py +24 -0
  67. agent/tools/base.py +253 -0
  68. agent/tools/browser_tool.py +423 -0
  69. agent/types.py +11 -5
  70. agent/ui/__init__.py +1 -1
  71. agent/ui/__main__.py +1 -1
  72. agent/ui/gradio/app.py +25 -22
  73. agent/ui/gradio/ui_components.py +314 -167
  74. cua_agent-0.7.16.dist-info/METADATA +85 -0
  75. cua_agent-0.7.16.dist-info/RECORD +79 -0
  76. {cua_agent-0.4.22.dist-info → cua_agent-0.7.16.dist-info}/WHEEL +1 -1
  77. cua_agent-0.4.22.dist-info/METADATA +0 -436
  78. cua_agent-0.4.22.dist-info/RECORD +0 -51
  79. {cua_agent-0.4.22.dist-info → cua_agent-0.7.16.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.1
2
+ Name: cua-agent
3
+ Version: 0.7.16
4
+ Summary: Cua (Computer Use) Agent for AI-driven computer interaction
5
+ Author-Email: TryCua <gh@trycua.com>
6
+ Requires-Python: <3.14,>=3.12
7
+ Requires-Dist: httpx>=0.27.0
8
+ Requires-Dist: aiohttp>=3.9.3
9
+ Requires-Dist: asyncio
10
+ Requires-Dist: anyio>=4.4.1
11
+ Requires-Dist: typing-extensions>=4.12.2
12
+ Requires-Dist: pydantic>=2.6.4
13
+ Requires-Dist: rich>=13.7.1
14
+ Requires-Dist: python-dotenv>=1.0.1
15
+ Requires-Dist: cua-computer<0.6.0,>=0.5.0
16
+ Requires-Dist: cua-core<0.2.0,>=0.1.8
17
+ Requires-Dist: certifi>=2024.2.2
18
+ Requires-Dist: litellm>=1.74.12
19
+ Provides-Extra: openai
20
+ Provides-Extra: anthropic
21
+ Provides-Extra: qwen
22
+ Requires-Dist: qwen-vl-utils; extra == "qwen"
23
+ Requires-Dist: qwen-agent; extra == "qwen"
24
+ Requires-Dist: Pillow>=10.0.0; extra == "qwen"
25
+ Provides-Extra: omni
26
+ Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "omni"
27
+ Provides-Extra: uitars
28
+ Provides-Extra: uitars-mlx
29
+ Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "uitars-mlx"
30
+ Provides-Extra: uitars-hf
31
+ Requires-Dist: accelerate; extra == "uitars-hf"
32
+ Requires-Dist: torch; extra == "uitars-hf"
33
+ Requires-Dist: transformers>=4.54.0; extra == "uitars-hf"
34
+ Provides-Extra: glm45v-hf
35
+ Requires-Dist: accelerate; extra == "glm45v-hf"
36
+ Requires-Dist: torch; extra == "glm45v-hf"
37
+ Requires-Dist: transformers-v4.55.0-GLM-4.5V-preview; extra == "glm45v-hf"
38
+ Provides-Extra: opencua-hf
39
+ Requires-Dist: accelerate; extra == "opencua-hf"
40
+ Requires-Dist: torch; extra == "opencua-hf"
41
+ Requires-Dist: transformers>=4.53.0; extra == "opencua-hf"
42
+ Requires-Dist: tiktoken>=0.11.0; extra == "opencua-hf"
43
+ Requires-Dist: blobfile>=3.0.0; extra == "opencua-hf"
44
+ Provides-Extra: internvl-hf
45
+ Requires-Dist: accelerate; extra == "internvl-hf"
46
+ Requires-Dist: torch; extra == "internvl-hf"
47
+ Requires-Dist: transformers>=4.55.0; extra == "internvl-hf"
48
+ Requires-Dist: einops; extra == "internvl-hf"
49
+ Requires-Dist: timm; extra == "internvl-hf"
50
+ Provides-Extra: moondream3
51
+ Requires-Dist: accelerate; extra == "moondream3"
52
+ Requires-Dist: torch; extra == "moondream3"
53
+ Requires-Dist: transformers>=4.55.0; extra == "moondream3"
54
+ Provides-Extra: ui
55
+ Requires-Dist: gradio>=6.0.0; extra == "ui"
56
+ Requires-Dist: python-dotenv>=1.0.1; extra == "ui"
57
+ Provides-Extra: cli
58
+ Requires-Dist: yaspin>=3.1.0; extra == "cli"
59
+ Provides-Extra: hud
60
+ Requires-Dist: hud-python==0.4.52; extra == "hud"
61
+ Provides-Extra: gemini
62
+ Requires-Dist: google-genai>=1.41.0; extra == "gemini"
63
+ Provides-Extra: all
64
+ Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "all"
65
+ Requires-Dist: accelerate; extra == "all"
66
+ Requires-Dist: torch; extra == "all"
67
+ Requires-Dist: transformers>=4.55.0; extra == "all"
68
+ Requires-Dist: einops; extra == "all"
69
+ Requires-Dist: timm; extra == "all"
70
+ Requires-Dist: tiktoken>=0.11.0; extra == "all"
71
+ Requires-Dist: blobfile>=3.0.0; extra == "all"
72
+ Requires-Dist: gradio>=6.0.0; extra == "all"
73
+ Requires-Dist: python-dotenv>=1.0.1; extra == "all"
74
+ Requires-Dist: yaspin>=3.1.0; extra == "all"
75
+ Requires-Dist: google-genai>=1.41.0; extra == "all"
76
+ Requires-Dist: qwen-vl-utils; extra == "all"
77
+ Requires-Dist: qwen-agent; extra == "all"
78
+ Requires-Dist: Pillow>=10.0.0; extra == "all"
79
+ Description-Content-Type: text/markdown
80
+
81
+ # Cua Agent
82
+
83
+ Computer-Use framework with liteLLM integration for running agentic workflows on macOS, Windows, and Linux sandboxes.
84
+
85
+ **[Documentation](https://cua.ai/docs/cua/reference/agent-sdk)** - Installation, guides, and configuration.
@@ -0,0 +1,79 @@
1
+ agent/__init__.py,sha256=zaQexECXUaHLjkkkS166vXBLV6gMcKC2ssL3nCfJ2wA,1250
2
+ agent/__main__.py,sha256=hD-1r72Evv3eJ7v6RhuU2vpusqxx-thbdrK5_iZGD-I,539
3
+ agent/adapters/__init__.py,sha256=UFIRGjyjHZzIuPJP_6LxrPF0YLL_1uVFve7sB20NTQQ,422
4
+ agent/adapters/azure_ml_adapter.py,sha256=Nr3hc6jSkEJ7NKcd-qewBitxPm0ECvCZz21DmOBLIsM,10364
5
+ agent/adapters/cua_adapter.py,sha256=JYiKicHx0Al3ItYFX33ulPIkSbdfCkL_BWeePH9timY,5886
6
+ agent/adapters/huggingfacelocal_adapter.py,sha256=dL9fuDNC3MaA67DQye5UT-Sq-gmD9_2NIS5UTWLlSjU,6641
7
+ agent/adapters/human_adapter.py,sha256=SWUYgJZ_o8_5qw6uuXEahBPeHQ2fCLrTrM7U1PhQta8,12548
8
+ agent/adapters/mlxvlm_adapter.py,sha256=n8Amj8RPmdnUHVZUW-HfwsLEqakrkwMp6KnwQKTHyAE,14277
9
+ agent/adapters/models/__init__.py,sha256=aojUJzqd02Zo0u4VdTgOiAWAxyzwjTrn-FuCAsAoBEs,1474
10
+ agent/adapters/models/generic.py,sha256=qwhJXc8v9s44x1r0RnlTCjAIl862pwx33OEhyfwc72Y,2782
11
+ agent/adapters/models/internvl.py,sha256=8V5l-A7sR43oePcCLdWL9p9BWS65tKW0jtCzS_Hc-Ls,11766
12
+ agent/adapters/models/opencua.py,sha256=KziBcGQl4fJ4ad-sdQeHqFP_Ez4hzJWxcMou-cBLAOI,4083
13
+ agent/adapters/models/qwen2_5_vl.py,sha256=QzZawBxA_yLmqcG2rTtrQtWkKubyI9Oik5Lv2FUyQlw,2823
14
+ agent/agent.py,sha256=4Db48Vk9zV5Y0pXP2bURsnqjKrloS7Fb0zF32NwBAgU,35575
15
+ agent/callbacks/__init__.py,sha256=0LCm6Su3tszYBqaXCroCkIveAkFE2UjBOms-Ku8NN4s,819
16
+ agent/callbacks/base.py,sha256=onbJlS6HzgptBYfvPIDe8-PWK71Zr3mFaGVUyupNwCo,4622
17
+ agent/callbacks/budget_manager.py,sha256=RQ0P4s-w6xvtLQsIxgZ5n-ocfcYnqljSlGftmG1cVk8,1899
18
+ agent/callbacks/image_retention.py,sha256=qWe_XLyisvZVYn-_WHyIgHSpcxdqdS0tJKI4ZvVyEXI,3578
19
+ agent/callbacks/logging.py,sha256=MNbWH3DxSkI7RZJ-BAwr6lCClXVDNM6864wNA2TAQ6g,10855
20
+ agent/callbacks/operator_validator.py,sha256=MrQZC5ySjHtjGryVrY8T0bUL9rOqSqTA7rMNqkqmXvU,6484
21
+ agent/callbacks/otel.py,sha256=4svx0T-vuDKT1qMQxP4SicINT6xpUwvoFy8GST9lLRg,8793
22
+ agent/callbacks/pii_anonymization.py,sha256=OSnb309Klc5GIQcrYuZvw-ddJJ0FNJ3U0WiJeT3Q8BA,3179
23
+ agent/callbacks/prompt_instructions.py,sha256=RUqsJhiNiXqaOM_P2AfyBinWUDdgDku46BExLMUJHn4,1517
24
+ agent/callbacks/telemetry.py,sha256=sVLQ2COK0TAQ2RJtdnlzMyQqGov566O2gWNDwxW27qk,8371
25
+ agent/callbacks/trajectory_saver.py,sha256=ASd5wmYSt2izEbjOtVobEn_7wbGcVapiMd51qpK8HaU,16011
26
+ agent/cli.py,sha256=B4wtY7YfcJbgrv5ocztj1pkPYqWjLhBRvVGLSPHntAM,17894
27
+ agent/computers/__init__.py,sha256=Q69OOH4m8GXY_O0BrEfwPkdiW7Muc97-N8DXi3maKOM,1475
28
+ agent/computers/base.py,sha256=Ud62zbSfgMuJ2Y6JrHVH25GG208rqKJBr4v1EXFfbKI,2310
29
+ agent/computers/cua.py,sha256=0QdX3aC4btiUWVZ9iAdxz9BXUL1viFWGYGZVE1CZ_kM,5621
30
+ agent/computers/custom.py,sha256=r010ew-tO0mq3sjvEPome2ELTA5tPCtEgInDyhICaak,7970
31
+ agent/decorators.py,sha256=KLSLczVt6AIh8IPp5YUIqJhNMpcbYUu-irCpc6uGKfI,1875
32
+ agent/human_tool/__init__.py,sha256=2lp9aZLdId4iooY6sdMw4TwVmDdAvsKyZFJla99BpA0,748
33
+ agent/human_tool/__main__.py,sha256=P4H50miHpkqRax6sfRG9PSRct2g82RLwfmshFvqpSLs,1069
34
+ agent/human_tool/server.py,sha256=YeTsVDwRFBn6x7lGCywNe3H94hA6Fsp8SFfHslhxkac,7933
35
+ agent/human_tool/ui.py,sha256=d_nhtJWH40tOwDP84t9EqnOiEpzDu88F2MvZR6kQu2M,30751
36
+ agent/integrations/hud/__init__.py,sha256=fVJXPhTdu3-2-8h1qC4kTCtsphgajUO-rnuDJbMnvbw,5854
37
+ agent/integrations/hud/agent.py,sha256=vfuU0t1vcwZhpxnuTNXs8-zQQ3p1RxJq53cI3PmGGqw,14544
38
+ agent/integrations/hud/proxy.py,sha256=Kj9grnLbuaCS-2y2TXVuRBQwqifzh-UX0Q916V9PWyY,11718
39
+ agent/loops/__init__.py,sha256=xLSxiw0zIpeyI60s-OLpPfANGs5DtOcRoFDCdmN-c0o,634
40
+ agent/loops/anthropic.py,sha256=asu9G0pssv2yrOsOOOhn51K6X11deF-HzFHQ-_qgE_A,73097
41
+ agent/loops/base.py,sha256=E61rNE8WttIXZ1-AP6k2cZeSp8dzvWkXzUOeU8SLwN8,2677
42
+ agent/loops/composed_grounded.py,sha256=Cc5w9gU-5D0MP-Wjb4XLcjuNIN9EeRKXNyMtLwRoq8I,12395
43
+ agent/loops/fara/__init__.py,sha256=kaN1VsFZOf0dWUPPX4M2qbTl3JqzN3O3jlq5ByOrkW8,182
44
+ agent/loops/fara/config.py,sha256=EO0WGxF_e51s16o7PP7gBBNqhpOeotB_1njbXNC_fmY,21478
45
+ agent/loops/fara/helpers.py,sha256=j5fWcVNdXM0vhtdDf9IjzlqCSgAh2XpKRhhn7C6b9MY,13657
46
+ agent/loops/fara/schema.py,sha256=rVZyF3kXecmg-uve9ekeeROk_Yo4tJId2NowyeNakOk,4221
47
+ agent/loops/gelato.py,sha256=72ctdzpaZRHqs_bsNquq-E5NisITzusOMJSB5pyxUZI,5784
48
+ agent/loops/gemini.py,sha256=U_yaexk1N60sB9Se5qAalcz1hr5JPt9kM_o8XsCtpLE,36564
49
+ agent/loops/generic_vlm.py,sha256=YnK96VqHnGaRndIves5riAEh3bY3lKP5ZlO90N68Vs8,24784
50
+ agent/loops/glm45v.py,sha256=HkLJMYMYbQDUBxD5upBMwY7jrJZh44UUaPKLjaYMUsI,34585
51
+ agent/loops/gta1.py,sha256=Q6OPf54_9Jvy0L4af9H8omyIfDTdrQVz7bmW_vKH-Gc,5597
52
+ agent/loops/holo.py,sha256=0FQJifXNrTaNIHaREb8R14byHOmzGvJfe_gUC5p9fP0,7503
53
+ agent/loops/internvl.py,sha256=x9CCwYvANEWrWgO0ThE0trUKng28g5306L3pBT4CEFI,6561
54
+ agent/loops/model_types.csv,sha256=GmFn4x80yoUpQZuQ-GXtJkPVlOLYWZ5u_5A73HRyeNE,112
55
+ agent/loops/moondream3.py,sha256=Dr7rL-yqXD3TR-2YT6xQ588WMVTB_uobdUF-oLtQi_Y,18557
56
+ agent/loops/omniparser.py,sha256=6LPPpYxdoQ9GvfoXg8DJRq52JhWJZDAKwxNviwRaxdk,19516
57
+ agent/loops/openai.py,sha256=XGzAs-de1qCNTWEUOZrHrK7CwmY7fpav-Q4k2fXbBcc,8469
58
+ agent/loops/opencua.py,sha256=XpOLQpwpd7zeCWg2BMmJt0QPglW8we4azC_ehqrhYys,4421
59
+ agent/loops/uiins.py,sha256=iDgOu0m_kfsHy4aN4ACaAqHI479Km1An5gFEC2oKuTw,6058
60
+ agent/loops/uitars.py,sha256=maXgyi2_Er8HN1VzPpVklSNkqF1yDWeIv27VGGRaEwE,32224
61
+ agent/loops/uitars2.py,sha256=405TyqOqMZfR61X_2ei8FEnadAHcbuxQYsJpGZVOMpM,37120
62
+ agent/playground/__init__.py,sha256=k-BpN4kailwxga_mlssokoDhNPut7hliex2aoCQ-S-0,110
63
+ agent/playground/server.py,sha256=-DTw6Bt8CHQjFWbIbTUZgD7ifdWWgyoj3x7N1oSC9Bk,11212
64
+ agent/proxy/examples.py,sha256=G-KfjSZMz7yvf9VYgCBt_XNDNN3aMbCjYHS-mbxttrA,6062
65
+ agent/proxy/handlers.py,sha256=w-mKONPzyRNJo5lPVIBKmpZgwMKW5uqGzYeRxlE2WTI,9930
66
+ agent/responses.py,sha256=DnGG7y_yos09Mk7mVFdUlmdw4JMeIndtAbYpLzvZKgo,35317
67
+ agent/tools/__init__.py,sha256=PrW8OUNrK1AKDgShJ1ZbKYz_JjFyj6s_CLvCCNztlzU,430
68
+ agent/tools/base.py,sha256=tF-Hsoyv57b6NGVHuVCB4VSe02HBL2BwRsJKm1So4FE,7510
69
+ agent/tools/browser_tool.py,sha256=rK4EY3q8prFLA8WJwUntPWGBwXYjJE21EOmncCWRy_U,18625
70
+ agent/types.py,sha256=qK8yjPIPAfXykXok9nS8dvmbFYFUUpxdd3W3JUMCFsI,1061
71
+ agent/ui/__init__.py,sha256=vHINeH6zAcseCZSFe7pzcsaIdVTVoATm5YhEJtZdeMM,126
72
+ agent/ui/__main__.py,sha256=Ee9KF16h4fWlb6J48OBqc7cQEbzSUZgNe0L7GlKsdpg,74
73
+ agent/ui/gradio/__init__.py,sha256=yv4Mrfo-Sj2U5sVn_UJHAuwYCezo-5O4ItR2C9jzNko,145
74
+ agent/ui/gradio/app.py,sha256=OCErZD_6vh8cdYGZFT-IiFQQpkoEiNwPDoEkPge-Ngg,8901
75
+ agent/ui/gradio/ui_components.py,sha256=B9CHC7sIMMEzsz5gdA16hMf8VVQ_-NO4lY49AKylciI,38852
76
+ cua_agent-0.7.16.dist-info/METADATA,sha256=Zxnt0OSOQEKBXFBwgui8IPjJI5TENvHQGOXupixp8cw,3433
77
+ cua_agent-0.7.16.dist-info/WHEEL,sha256=tsUv_t7BDeJeRHaSrczbGeuK-TtDpGsWi_JfpzD255I,90
78
+ cua_agent-0.7.16.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
79
+ cua_agent-0.7.16.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.4.5)
2
+ Generator: pdm-backend (2.4.6)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,436 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: cua-agent
3
- Version: 0.4.22
4
- Summary: CUA (Computer Use) Agent for AI-driven computer interaction
5
- Author-Email: TryCua <gh@trycua.com>
6
- Requires-Python: >=3.12
7
- Requires-Dist: httpx>=0.27.0
8
- Requires-Dist: aiohttp>=3.9.3
9
- Requires-Dist: asyncio
10
- Requires-Dist: anyio>=4.4.1
11
- Requires-Dist: typing-extensions>=4.12.2
12
- Requires-Dist: pydantic>=2.6.4
13
- Requires-Dist: rich>=13.7.1
14
- Requires-Dist: python-dotenv>=1.0.1
15
- Requires-Dist: cua-computer<0.5.0,>=0.4.0
16
- Requires-Dist: cua-core<0.2.0,>=0.1.8
17
- Requires-Dist: certifi>=2024.2.2
18
- Requires-Dist: litellm>=1.74.12
19
- Provides-Extra: openai
20
- Provides-Extra: anthropic
21
- Provides-Extra: omni
22
- Requires-Dist: ultralytics>=8.0.0; extra == "omni"
23
- Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "omni"
24
- Provides-Extra: uitars
25
- Provides-Extra: uitars-mlx
26
- Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "uitars-mlx"
27
- Provides-Extra: uitars-hf
28
- Requires-Dist: accelerate; extra == "uitars-hf"
29
- Requires-Dist: torch; extra == "uitars-hf"
30
- Requires-Dist: transformers>=4.54.0; extra == "uitars-hf"
31
- Provides-Extra: glm45v-hf
32
- Requires-Dist: accelerate; extra == "glm45v-hf"
33
- Requires-Dist: torch; extra == "glm45v-hf"
34
- Requires-Dist: transformers-v4.55.0-GLM-4.5V-preview; extra == "glm45v-hf"
35
- Provides-Extra: ui
36
- Requires-Dist: gradio>=5.23.3; extra == "ui"
37
- Requires-Dist: python-dotenv>=1.0.1; extra == "ui"
38
- Provides-Extra: cli
39
- Requires-Dist: yaspin>=3.1.0; extra == "cli"
40
- Provides-Extra: hud
41
- Requires-Dist: hud-python<0.5.0,>=0.4.12; extra == "hud"
42
- Provides-Extra: all
43
- Requires-Dist: ultralytics>=8.0.0; extra == "all"
44
- Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "all"
45
- Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "all"
46
- Requires-Dist: accelerate; extra == "all"
47
- Requires-Dist: torch; extra == "all"
48
- Requires-Dist: transformers>=4.54.0; extra == "all"
49
- Requires-Dist: gradio>=5.23.3; extra == "all"
50
- Requires-Dist: python-dotenv>=1.0.1; extra == "all"
51
- Requires-Dist: yaspin>=3.1.0; extra == "all"
52
- Requires-Dist: hud-python<0.5.0,>=0.4.12; extra == "all"
53
- Description-Content-Type: text/markdown
54
-
55
- <div align="center">
56
- <h1>
57
- <div class="image-wrapper" style="display: inline-block;">
58
- <picture>
59
- <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;">
60
- <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;">
61
- <img alt="Shows my svg">
62
- </picture>
63
- </div>
64
-
65
- [![Python](https://img.shields.io/badge/Python-333333?logo=python&logoColor=white&labelColor=333333)](#)
66
- [![macOS](https://img.shields.io/badge/macOS-000000?logo=apple&logoColor=F0F0F0)](#)
67
- [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white)](https://discord.com/invite/mVnXXpdE85)
68
- [![PyPI](https://img.shields.io/pypi/v/cua-computer?color=333333)](https://pypi.org/project/cua-computer/)
69
- </h1>
70
- </div>
71
-
72
- **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.
73
-
74
- ## Features
75
-
76
- - **Safe Computer-Use/Tool-Use**: Using Computer SDK for sandboxed desktops
77
- - **Multi-Agent Support**: Anthropic Claude, OpenAI computer-use-preview, UI-TARS, Omniparser + any LLM
78
- - **Multi-API Support**: Take advantage of liteLLM supporting 100+ LLMs / model APIs, including local models (`huggingface-local/`, `ollama_chat/`, `mlx/`)
79
- - **Cross-Platform**: Works on Windows, macOS, and Linux with cloud and local computer instances
80
- - **Extensible Callbacks**: Built-in support for image retention, cache control, PII anonymization, budget limits, and trajectory tracking
81
-
82
- ## Install
83
-
84
- ```bash
85
- pip install "cua-agent[all]"
86
-
87
- # or install specific providers
88
- pip install "cua-agent[openai]" # OpenAI computer-use-preview support
89
- pip install "cua-agent[anthropic]" # Anthropic Claude support
90
- pip install "cua-agent[omni]" # Omniparser + any LLM support
91
- pip install "cua-agent[uitars]" # UI-TARS
92
- pip install "cua-agent[uitars-mlx]" # UI-TARS + MLX support
93
- pip install "cua-agent[uitars-hf]" # UI-TARS + Huggingface support
94
- pip install "cua-agent[glm45v-hf]" # GLM-4.5V + Huggingface support
95
- pip install "cua-agent[ui]" # Gradio UI support
96
- ```
97
-
98
- ## Quick Start
99
-
100
- ```python
101
- import asyncio
102
- import os
103
- from agent import ComputerAgent
104
- from computer import Computer
105
-
106
- async def main():
107
- # Set up computer instance
108
- async with Computer(
109
- os_type="linux",
110
- provider_type="cloud",
111
- name=os.getenv("CUA_CONTAINER_NAME"),
112
- api_key=os.getenv("CUA_API_KEY")
113
- ) as computer:
114
-
115
- # Create agent
116
- agent = ComputerAgent(
117
- model="anthropic/claude-3-5-sonnet-20241022",
118
- tools=[computer],
119
- only_n_most_recent_images=3,
120
- trajectory_dir="trajectories",
121
- max_trajectory_budget=5.0 # $5 budget limit
122
- )
123
-
124
- # Run agent
125
- messages = [{"role": "user", "content": "Take a screenshot and tell me what you see"}]
126
-
127
- async for result in agent.run(messages):
128
- for item in result["output"]:
129
- if item["type"] == "message":
130
- print(item["content"][0]["text"])
131
-
132
- if __name__ == "__main__":
133
- asyncio.run(main())
134
- ```
135
-
136
- ## Supported Models
137
-
138
- ### Anthropic Claude (Computer Use API)
139
- ```python
140
- model="anthropic/claude-3-5-sonnet-20241022"
141
- model="anthropic/claude-3-7-sonnet-20250219"
142
- model="anthropic/claude-opus-4-20250514"
143
- model="anthropic/claude-sonnet-4-20250514"
144
- ```
145
-
146
- ### OpenAI Computer Use Preview
147
- ```python
148
- model="openai/computer-use-preview"
149
- ```
150
-
151
- ### UI-TARS (Local or Huggingface Inference)
152
- ```python
153
- model="huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B"
154
- model="ollama_chat/0000/ui-tars-1.5-7b"
155
- ```
156
-
157
- ### Omniparser + Any LLM
158
- ```python
159
- model="omniparser+ollama_chat/mistral-small3.2"
160
- model="omniparser+vertex_ai/gemini-pro"
161
- model="omniparser+anthropic/claude-3-5-sonnet-20241022"
162
- model="omniparser+openai/gpt-4o"
163
- ```
164
-
165
- ## Custom Tools
166
-
167
- Define custom tools using decorated functions:
168
-
169
- ```python
170
- from computer.helpers import sandboxed
171
-
172
- @sandboxed()
173
- def read_file(location: str) -> str:
174
- """Read contents of a file
175
-
176
- Parameters
177
- ----------
178
- location : str
179
- Path to the file to read
180
-
181
- Returns
182
- -------
183
- str
184
- Contents of the file or error message
185
- """
186
- try:
187
- with open(location, 'r') as f:
188
- return f.read()
189
- except Exception as e:
190
- return f"Error reading file: {str(e)}"
191
-
192
- def calculate(a: int, b: int) -> int:
193
- """Calculate the sum of two integers"""
194
- return a + b
195
-
196
- # Use with agent
197
- agent = ComputerAgent(
198
- model="anthropic/claude-3-5-sonnet-20241022",
199
- tools=[computer, read_file, calculate]
200
- )
201
- ```
202
-
203
- ## Callbacks System
204
-
205
- agent provides a comprehensive callback system for extending functionality:
206
-
207
- ### Built-in Callbacks
208
-
209
- ```python
210
- from agent.callbacks import (
211
- ImageRetentionCallback,
212
- TrajectorySaverCallback,
213
- BudgetManagerCallback,
214
- LoggingCallback
215
- )
216
-
217
- agent = ComputerAgent(
218
- model="anthropic/claude-3-5-sonnet-20241022",
219
- tools=[computer],
220
- callbacks=[
221
- ImageRetentionCallback(only_n_most_recent_images=3),
222
- TrajectorySaverCallback(trajectory_dir="trajectories"),
223
- BudgetManagerCallback(max_budget=10.0, raise_error=True),
224
- LoggingCallback(level=logging.INFO)
225
- ]
226
- )
227
- ```
228
-
229
- ### Custom Callbacks
230
-
231
- ```python
232
- from agent.callbacks.base import AsyncCallbackHandler
233
-
234
- class CustomCallback(AsyncCallbackHandler):
235
- async def on_llm_start(self, messages):
236
- """Preprocess messages before LLM call"""
237
- # Add custom preprocessing logic
238
- return messages
239
-
240
- async def on_llm_end(self, messages):
241
- """Postprocess messages after LLM call"""
242
- # Add custom postprocessing logic
243
- return messages
244
-
245
- async def on_usage(self, usage):
246
- """Track usage information"""
247
- print(f"Tokens used: {usage.total_tokens}")
248
- ```
249
-
250
- ## Budget Management
251
-
252
- Control costs with built-in budget management:
253
-
254
- ```python
255
- # Simple budget limit
256
- agent = ComputerAgent(
257
- model="anthropic/claude-3-5-sonnet-20241022",
258
- max_trajectory_budget=5.0 # $5 limit
259
- )
260
-
261
- # Advanced budget configuration
262
- agent = ComputerAgent(
263
- model="anthropic/claude-3-5-sonnet-20241022",
264
- max_trajectory_budget={
265
- "max_budget": 10.0,
266
- "raise_error": True, # Raise error when exceeded
267
- "reset_after_each_run": False # Persistent across runs
268
- }
269
- )
270
- ```
271
-
272
- ## Trajectory Management
273
-
274
- Save and replay agent conversations:
275
-
276
- ```python
277
- agent = ComputerAgent(
278
- model="anthropic/claude-3-5-sonnet-20241022",
279
- trajectory_dir="trajectories", # Auto-save trajectories
280
- tools=[computer]
281
- )
282
-
283
- # Trajectories are saved with:
284
- # - Complete conversation history
285
- # - Usage statistics and costs
286
- # - Timestamps and metadata
287
- # - Screenshots and computer actions
288
- ```
289
-
290
- ## Configuration Options
291
-
292
- ### ComputerAgent Parameters
293
-
294
- - `model`: Model identifier (required)
295
- - `tools`: List of computer objects and decorated functions
296
- - `callbacks`: List of callback handlers for extensibility
297
- - `only_n_most_recent_images`: Limit recent images to prevent context overflow
298
- - `verbosity`: Logging level (logging.INFO, logging.DEBUG, etc.)
299
- - `trajectory_dir`: Directory to save conversation trajectories
300
- - `max_retries`: Maximum API call retries (default: 3)
301
- - `screenshot_delay`: Delay between actions and screenshots (default: 0.5s)
302
- - `use_prompt_caching`: Enable prompt caching for supported models
303
- - `max_trajectory_budget`: Budget limit configuration
304
-
305
- ### Environment Variables
306
-
307
- ```bash
308
- # Computer instance (cloud)
309
- export CUA_CONTAINER_NAME="your-container-name"
310
- export CUA_API_KEY="your-cua-api-key"
311
-
312
- # LLM API keys
313
- export ANTHROPIC_API_KEY="your-anthropic-key"
314
- export OPENAI_API_KEY="your-openai-key"
315
- ```
316
-
317
- ## Advanced Usage
318
-
319
- ### Streaming Responses
320
-
321
- ```python
322
- async for result in agent.run(messages, stream=True):
323
- # Process streaming chunks
324
- for item in result["output"]:
325
- if item["type"] == "message":
326
- print(item["content"][0]["text"], end="", flush=True)
327
- elif item["type"] == "computer_call":
328
- action = item["action"]
329
- print(f"\n[Action: {action['type']}]")
330
- ```
331
-
332
- ### Interactive Chat Loop
333
-
334
- ```python
335
- history = []
336
- while True:
337
- user_input = input("> ")
338
- if user_input.lower() in ['quit', 'exit']:
339
- break
340
-
341
- history.append({"role": "user", "content": user_input})
342
-
343
- async for result in agent.run(history):
344
- history += result["output"]
345
-
346
- # Display assistant responses
347
- for item in result["output"]:
348
- if item["type"] == "message":
349
- print(item["content"][0]["text"])
350
- ```
351
-
352
- ### Error Handling
353
-
354
- ```python
355
- try:
356
- async for result in agent.run(messages):
357
- # Process results
358
- pass
359
- except BudgetExceededException:
360
- print("Budget limit exceeded")
361
- except Exception as e:
362
- print(f"Agent error: {e}")
363
- ```
364
-
365
- ## API Reference
366
-
367
- ### ComputerAgent.run()
368
-
369
- ```python
370
- async def run(
371
- self,
372
- messages: Messages,
373
- stream: bool = False,
374
- **kwargs
375
- ) -> AsyncGenerator[Dict[str, Any], None]:
376
- """
377
- Run the agent with the given messages.
378
-
379
- Args:
380
- messages: List of message dictionaries
381
- stream: Whether to stream the response
382
- **kwargs: Additional arguments
383
-
384
- Returns:
385
- AsyncGenerator that yields response chunks
386
- """
387
- ```
388
-
389
- ### Message Format
390
-
391
- ```python
392
- messages = [
393
- {
394
- "role": "user",
395
- "content": "Take a screenshot and describe what you see"
396
- },
397
- {
398
- "role": "assistant",
399
- "content": "I'll take a screenshot for you."
400
- }
401
- ]
402
- ```
403
-
404
- ### Response Format
405
-
406
- ```python
407
- {
408
- "output": [
409
- {
410
- "type": "message",
411
- "role": "assistant",
412
- "content": [{"type": "output_text", "text": "I can see..."}]
413
- },
414
- {
415
- "type": "computer_call",
416
- "action": {"type": "screenshot"},
417
- "call_id": "call_123"
418
- },
419
- {
420
- "type": "computer_call_output",
421
- "call_id": "call_123",
422
- "output": {"image_url": "data:image/png;base64,..."}
423
- }
424
- ],
425
- "usage": {
426
- "prompt_tokens": 150,
427
- "completion_tokens": 75,
428
- "total_tokens": 225,
429
- "response_cost": 0.01,
430
- }
431
- }
432
- ```
433
-
434
- ## License
435
-
436
- MIT License - see LICENSE file for details.
@@ -1,51 +0,0 @@
1
- agent/__init__.py,sha256=MaW-BczJ-lCACPYH39DvFhE7ZWiSo7sBO6pBfyO7Nxc,1269
2
- agent/__main__.py,sha256=lBUe8Niqa5XoCjwFfXyX7GtnUwjjZXC1-j4V9mvUYSc,538
3
- agent/adapters/__init__.py,sha256=Q_OxxwXBcBIetQ_DtHS5bwZWXrvCKPX2grCg8R0UKek,301
4
- agent/adapters/huggingfacelocal_adapter.py,sha256=Uqjtcohhzd33VFh38Ra2y4Uv_lTghMswoqS1t-KKFkw,8480
5
- agent/adapters/human_adapter.py,sha256=xT4nnfNXb1z-vnGFlLmFEZN7TMcoMBGS40MtR1Zwv4o,13079
6
- agent/adapters/mlxvlm_adapter.py,sha256=4VhhKDZfLLKL5joL1v4PPFvYw-R8spoDsat3vOAGnpE,14864
7
- agent/agent.py,sha256=ao3SKnZoX5_P6mTzEg0hgOUam6bNRwpbitzlyvwI3bg,29826
8
- agent/callbacks/__init__.py,sha256=et6pNfX_AiJqhVzUfCvcjzFbDhfLoHazKCXN5sqwxaM,631
9
- agent/callbacks/base.py,sha256=UnnnYlh6XCm6HKZZsAPaT_Eyo9LUYLyjyNwF-QRm6Ns,4691
10
- agent/callbacks/budget_manager.py,sha256=RyKM-7iXQcDotYvrw3eURzeEHEXvQjID-NobtvQWE7k,1832
11
- agent/callbacks/image_retention.py,sha256=tiuRT5ke9xXTb2eP8Gz-2ITyAMY29LURUH6AbjX3RP8,6165
12
- agent/callbacks/logging.py,sha256=OOxU97EzrxlnUAtiEnvy9FB7SwCUK90-rdpDFA2Ae4E,10921
13
- agent/callbacks/operator_validator.py,sha256=dLvR749glMPiGt8UP-XMLm_LcaTUUhWvRZJN_qkHV7Y,6430
14
- agent/callbacks/pii_anonymization.py,sha256=NEkUTUjQBi82nqus7kT-1E4RaeQ2hQrY7YCnKndLhP8,3272
15
- agent/callbacks/telemetry.py,sha256=RbUDhE41mTi8g9hNre0EpltK_NUZkLj8buJLWBzs0Ek,7363
16
- agent/callbacks/trajectory_saver.py,sha256=rslgg4Ak7JHSNmmJgANRQ5TsUYWGuUJDZ6amureaz_o,15963
17
- agent/cli.py,sha256=AgaXwywHd3nGQWuqMRj6SbPyFaCPjfo5980Y1ApQOTQ,12413
18
- agent/computers/__init__.py,sha256=39ISJsaREaQIZckpzxSuLhuR763wUU3TxUux78EKjAg,1477
19
- agent/computers/base.py,sha256=hZntX4vgc1ahD3EnFeb9lUjtBmgka1vb27hndPl9tKQ,2187
20
- agent/computers/cua.py,sha256=xp2A34kT2C1NKqSRo2GB6766gkraM-UtpFjRv8LUTSc,4889
21
- agent/computers/custom.py,sha256=I_CHXvczLg43c_QBk8F_WDOlaSOOzK6b-Tkum2OSRIM,8029
22
- agent/decorators.py,sha256=n8VvMsififWkmuk75Q7HIpo0xAA2yAeQ6J-OOiwbAKc,1836
23
- agent/human_tool/__init__.py,sha256=3m5_g-Fo_0yX5vi7eg-A92oTqO0N3aY929Ajp78HKsE,771
24
- agent/human_tool/__main__.py,sha256=VsW2BAghlonOuqZbP_xuCsaec9bemA1I_ibnDcED9D4,1068
25
- agent/human_tool/server.py,sha256=ceuL5kw_RjgAi8fueLU3nTjyzOLE25Shv1oTJnSHsoQ,7964
26
- agent/human_tool/ui.py,sha256=2Jk3Bh-Jctya8GUG-qtYbdi-1qDdwOtcAlUeiIqsoIE,26584
27
- agent/integrations/hud/__init__.py,sha256=q0QEyJZSrcjiN2sRi_hoX-ePmLyYm9CpAIvA0xMxGJI,8360
28
- agent/integrations/hud/proxy.py,sha256=yA7C2jeXnrpI5HS0VgCvn0BflVbAORZynIfyE27rvBg,7782
29
- agent/loops/__init__.py,sha256=Ef8aj07l3osibwDk-DTo80PrpL4_GdKRTP1ikl_b-BQ,328
30
- agent/loops/anthropic.py,sha256=Th3dNv8FULvyDXx7aPVGSzbrqBiDNFXRso3DSa88d_w,70301
31
- agent/loops/base.py,sha256=LK7kSTnc2CB88LI7qr2VP7LMq0eS5r2bSEnrxO6IN5U,2345
32
- agent/loops/composed_grounded.py,sha256=8oJoqaRzKWbI9I4VoFuAoUzQ11_CFnYT-EdPOy-NVEQ,12349
33
- agent/loops/glm45v.py,sha256=V1f-5vAifbYcY-qTc7fW2KXVRkAfApQI_EjavH3X2ak,35110
34
- agent/loops/gta1.py,sha256=ha5TaUWqUzTffx_ow1WiBU8i3VNP-6FL5XC66ajPFjg,5829
35
- agent/loops/model_types.csv,sha256=GmFn4x80yoUpQZuQ-GXtJkPVlOLYWZ5u_5A73HRyeNE,112
36
- agent/loops/omniparser.py,sha256=-db8JUL2Orn47ERIaLbuNShAXn4LeIgYzRWphn_9Dg4,15071
37
- agent/loops/openai.py,sha256=3UEXdecqGkyknhTgp6zxr_cNCVg5vM-61I6SKMNl6m8,8692
38
- agent/loops/uitars.py,sha256=QyEWyrhkI5MCksTunntY-5jtETd4pwcQB-DyzmiWezo,32350
39
- agent/proxy/examples.py,sha256=GYFJ-sfDsSNZr9n_qpvDx_0rShqoKE5JW0ibbljWfoo,6192
40
- agent/proxy/handlers.py,sha256=48mMNyZOU3dJQ6oI5r2kDDe29rcU49MConlB0MZeCsU,9602
41
- agent/responses.py,sha256=_SoN4BkaTxMHMB21EOtDc_aDBIJlfDwsCzszMBnIkH0,30764
42
- agent/types.py,sha256=h6SnmTAEAaryVCjwVZFAuCbio9UW13OqgQEV7HKmZVM,1060
43
- agent/ui/__init__.py,sha256=DTZpK85QXscXK2nM9HtpAhVBF13yAamUrtwrQSuV-kM,126
44
- agent/ui/__main__.py,sha256=vudWXYvGM0aNT5aZ94HPtGW8YXOZ4cLXepHyhUM_k1g,73
45
- agent/ui/gradio/__init__.py,sha256=yv4Mrfo-Sj2U5sVn_UJHAuwYCezo-5O4ItR2C9jzNko,145
46
- agent/ui/gradio/app.py,sha256=Ol97YEbwREZZQ9_PMjVHlfOcu9BGsawxgAGAm79hT80,9117
47
- agent/ui/gradio/ui_components.py,sha256=dJUvKDmc1oSejtoR_gU_oWWYwxaOOQyPloSYRGMrUCQ,36068
48
- cua_agent-0.4.22.dist-info/METADATA,sha256=pJw4ucNwM-cTifQAAz9I4Zw547lq4dbF06leL4qxFTY,12712
49
- cua_agent-0.4.22.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
50
- cua_agent-0.4.22.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
51
- cua_agent-0.4.22.dist-info/RECORD,,