cua-agent 0.1.0__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.
- agent/README.md +63 -0
- agent/__init__.py +10 -0
- agent/core/README.md +101 -0
- agent/core/__init__.py +34 -0
- agent/core/agent.py +284 -0
- agent/core/base_agent.py +164 -0
- agent/core/callbacks.py +147 -0
- agent/core/computer_agent.py +69 -0
- agent/core/experiment.py +222 -0
- agent/core/factory.py +102 -0
- agent/core/loop.py +244 -0
- agent/core/messages.py +230 -0
- agent/core/tools/__init__.py +21 -0
- agent/core/tools/base.py +74 -0
- agent/core/tools/bash.py +52 -0
- agent/core/tools/collection.py +46 -0
- agent/core/tools/computer.py +113 -0
- agent/core/tools/edit.py +67 -0
- agent/core/tools/manager.py +56 -0
- agent/providers/__init__.py +4 -0
- agent/providers/anthropic/__init__.py +6 -0
- agent/providers/anthropic/api/client.py +222 -0
- agent/providers/anthropic/api/logging.py +150 -0
- agent/providers/anthropic/callbacks/manager.py +55 -0
- agent/providers/anthropic/loop.py +521 -0
- agent/providers/anthropic/messages/manager.py +110 -0
- agent/providers/anthropic/prompts.py +20 -0
- agent/providers/anthropic/tools/__init__.py +33 -0
- agent/providers/anthropic/tools/base.py +88 -0
- agent/providers/anthropic/tools/bash.py +163 -0
- agent/providers/anthropic/tools/collection.py +34 -0
- agent/providers/anthropic/tools/computer.py +550 -0
- agent/providers/anthropic/tools/edit.py +326 -0
- agent/providers/anthropic/tools/manager.py +54 -0
- agent/providers/anthropic/tools/run.py +42 -0
- agent/providers/anthropic/types.py +16 -0
- agent/providers/omni/__init__.py +27 -0
- agent/providers/omni/callbacks.py +78 -0
- agent/providers/omni/clients/anthropic.py +99 -0
- agent/providers/omni/clients/base.py +44 -0
- agent/providers/omni/clients/groq.py +101 -0
- agent/providers/omni/clients/openai.py +159 -0
- agent/providers/omni/clients/utils.py +25 -0
- agent/providers/omni/experiment.py +273 -0
- agent/providers/omni/image_utils.py +106 -0
- agent/providers/omni/loop.py +961 -0
- agent/providers/omni/messages.py +168 -0
- agent/providers/omni/parser.py +252 -0
- agent/providers/omni/prompts.py +78 -0
- agent/providers/omni/tool_manager.py +91 -0
- agent/providers/omni/tools/__init__.py +13 -0
- agent/providers/omni/tools/bash.py +69 -0
- agent/providers/omni/tools/computer.py +216 -0
- agent/providers/omni/tools/manager.py +83 -0
- agent/providers/omni/types.py +30 -0
- agent/providers/omni/utils.py +155 -0
- agent/providers/omni/visualization.py +130 -0
- agent/types/__init__.py +26 -0
- agent/types/base.py +52 -0
- agent/types/messages.py +36 -0
- agent/types/tools.py +32 -0
- cua_agent-0.1.0.dist-info/METADATA +44 -0
- cua_agent-0.1.0.dist-info/RECORD +65 -0
- cua_agent-0.1.0.dist-info/WHEEL +4 -0
- cua_agent-0.1.0.dist-info/entry_points.txt +4 -0
agent/types/messages.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Message-related type definitions."""
|
|
2
|
+
|
|
3
|
+
from typing import List, Dict, Any, Optional
|
|
4
|
+
from pydantic import BaseModel, ConfigDict
|
|
5
|
+
|
|
6
|
+
from .tools import ToolInvocation
|
|
7
|
+
|
|
8
|
+
class Message(BaseModel):
|
|
9
|
+
"""Base message type."""
|
|
10
|
+
model_config = ConfigDict(extra='forbid')
|
|
11
|
+
role: str
|
|
12
|
+
content: str
|
|
13
|
+
annotations: Optional[List[Dict[str, Any]]] = None
|
|
14
|
+
toolInvocations: Optional[List[ToolInvocation]] = None
|
|
15
|
+
data: Optional[List[Dict[str, Any]]] = None
|
|
16
|
+
errors: Optional[List[str]] = None
|
|
17
|
+
|
|
18
|
+
class Request(BaseModel):
|
|
19
|
+
"""Request type."""
|
|
20
|
+
model_config = ConfigDict(extra='forbid')
|
|
21
|
+
messages: List[Message]
|
|
22
|
+
selectedModel: str
|
|
23
|
+
|
|
24
|
+
class Response(BaseModel):
|
|
25
|
+
"""Response type."""
|
|
26
|
+
model_config = ConfigDict(extra='forbid')
|
|
27
|
+
messages: List[Message]
|
|
28
|
+
vm_url: str
|
|
29
|
+
|
|
30
|
+
class StepMessage(Message):
|
|
31
|
+
"""Message for a single step."""
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
class DisengageMessage(BaseModel):
|
|
35
|
+
"""Message indicating disengagement."""
|
|
36
|
+
pass
|
agent/types/tools.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Tool-related type definitions."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import Dict, Any, Optional
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
|
+
|
|
7
|
+
class ToolInvocationState(str, Enum):
|
|
8
|
+
"""States for tool invocation."""
|
|
9
|
+
CALL = 'call'
|
|
10
|
+
PARTIAL_CALL = 'partial-call'
|
|
11
|
+
RESULT = 'result'
|
|
12
|
+
|
|
13
|
+
class ToolInvocation(BaseModel):
|
|
14
|
+
"""Tool invocation type."""
|
|
15
|
+
model_config = ConfigDict(extra='forbid')
|
|
16
|
+
state: Optional[str] = None
|
|
17
|
+
toolCallId: str
|
|
18
|
+
toolName: Optional[str] = None
|
|
19
|
+
args: Optional[Dict[str, Any]] = None
|
|
20
|
+
|
|
21
|
+
class ClientAttachment(BaseModel):
|
|
22
|
+
"""Client attachment type."""
|
|
23
|
+
name: str
|
|
24
|
+
contentType: str
|
|
25
|
+
url: str
|
|
26
|
+
|
|
27
|
+
class ToolResult(BaseModel):
|
|
28
|
+
"""Result of a tool execution."""
|
|
29
|
+
model_config = ConfigDict(extra='forbid')
|
|
30
|
+
output: Optional[str] = None
|
|
31
|
+
error: Optional[str] = None
|
|
32
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cua-agent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CUA (Computer Use) Agent for AI-driven computer interaction
|
|
5
|
+
Author-Email: TryCua <gh@trycua.com>
|
|
6
|
+
Requires-Python: <3.13,>=3.10
|
|
7
|
+
Requires-Dist: httpx<0.29.0,>=0.27.0
|
|
8
|
+
Requires-Dist: aiohttp<4.0.0,>=3.9.3
|
|
9
|
+
Requires-Dist: asyncio
|
|
10
|
+
Requires-Dist: anyio<5.0.0,>=4.4.1
|
|
11
|
+
Requires-Dist: typing-extensions<5.0.0,>=4.12.2
|
|
12
|
+
Requires-Dist: pydantic<3.0.0,>=2.6.4
|
|
13
|
+
Requires-Dist: rich<14.0.0,>=13.7.1
|
|
14
|
+
Requires-Dist: python-dotenv<2.0.0,>=1.0.1
|
|
15
|
+
Requires-Dist: cua-computer<0.2.0,>=0.1.0
|
|
16
|
+
Requires-Dist: certifi>=2024.2.2
|
|
17
|
+
Provides-Extra: anthropic
|
|
18
|
+
Requires-Dist: anthropic>=0.49.0; extra == "anthropic"
|
|
19
|
+
Requires-Dist: boto3<2.0.0,>=1.35.81; extra == "anthropic"
|
|
20
|
+
Provides-Extra: som
|
|
21
|
+
Requires-Dist: torch>=2.2.1; extra == "som"
|
|
22
|
+
Requires-Dist: torchvision>=0.17.1; extra == "som"
|
|
23
|
+
Requires-Dist: ultralytics>=8.0.0; extra == "som"
|
|
24
|
+
Requires-Dist: transformers>=4.38.2; extra == "som"
|
|
25
|
+
Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "som"
|
|
26
|
+
Requires-Dist: anthropic<0.47.0,>=0.46.0; extra == "som"
|
|
27
|
+
Requires-Dist: boto3<2.0.0,>=1.35.81; extra == "som"
|
|
28
|
+
Requires-Dist: openai<2.0.0,>=1.14.0; extra == "som"
|
|
29
|
+
Requires-Dist: groq<0.5.0,>=0.4.0; extra == "som"
|
|
30
|
+
Requires-Dist: dashscope<2.0.0,>=1.13.0; extra == "som"
|
|
31
|
+
Requires-Dist: requests<3.0.0,>=2.31.0; extra == "som"
|
|
32
|
+
Provides-Extra: all
|
|
33
|
+
Requires-Dist: torch>=2.2.1; extra == "all"
|
|
34
|
+
Requires-Dist: torchvision>=0.17.1; extra == "all"
|
|
35
|
+
Requires-Dist: ultralytics>=8.0.0; extra == "all"
|
|
36
|
+
Requires-Dist: transformers>=4.38.2; extra == "all"
|
|
37
|
+
Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "all"
|
|
38
|
+
Requires-Dist: anthropic<0.47.0,>=0.46.0; extra == "all"
|
|
39
|
+
Requires-Dist: boto3<2.0.0,>=1.35.81; extra == "all"
|
|
40
|
+
Requires-Dist: openai<2.0.0,>=1.14.0; extra == "all"
|
|
41
|
+
Requires-Dist: groq<0.5.0,>=0.4.0; extra == "all"
|
|
42
|
+
Requires-Dist: dashscope<2.0.0,>=1.13.0; extra == "all"
|
|
43
|
+
Requires-Dist: requests<3.0.0,>=2.31.0; extra == "all"
|
|
44
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
agent/README.md,sha256=8EFnLrKejthEcL9bZflQSbvA-KwpiPanBz8TEEwRub8,2153
|
|
2
|
+
agent/__init__.py,sha256=16Q828puFb7Ucq_-de49moVCzl1-iDO8Uo5dzFwX0Ag,347
|
|
3
|
+
agent/core/README.md,sha256=RY4kKEjm_-_Ul2xgY7ntzsXdPe0Tg1wvtOSZ4xp4DN0,3559
|
|
4
|
+
agent/core/__init__.py,sha256=0htZ-VfsH9ixHB8j_SXu_uv6r3XXsq5TrghFNd-yRNE,709
|
|
5
|
+
agent/core/agent.py,sha256=q2x0vFykIavX_FBi4Eq222QCSFmuuekAin4FPrtSGbY,11711
|
|
6
|
+
agent/core/base_agent.py,sha256=MgaMKTwgqNJ1-TgS_mxALoC9COzc7Acg9y7Q8HAFX2c,6266
|
|
7
|
+
agent/core/callbacks.py,sha256=VbGIf5QkHh3Q0KsLM6wv7hRdIA5WExTVYLm64bckyUA,4306
|
|
8
|
+
agent/core/computer_agent.py,sha256=JGLMl_PwImUttmQh2amdLlXHS9CUyZ9MW20J1Xid7dM,2417
|
|
9
|
+
agent/core/experiment.py,sha256=AST1t83eqaGzjoW6KvrhfVIs3ELAR_I70VHq2NsMmNk,7446
|
|
10
|
+
agent/core/factory.py,sha256=WraOEHWPXBSN4R3DO7M2ctyadodeA8tzHM3dUjdQ_3A,3441
|
|
11
|
+
agent/core/loop.py,sha256=E-0pz7MaguZQrHs5GP98Oc8C_Iz8ier0vXrD9Ny2HL8,8999
|
|
12
|
+
agent/core/messages.py,sha256=Ou0lLEwa2EQCartcTszsvNjCP6sHUxmr2_C9PGzbASg,7163
|
|
13
|
+
agent/core/tools/__init__.py,sha256=xZen-PqUp2dUaMEHJowXCQm33_5Sxhsx9PSoD0rq6tI,489
|
|
14
|
+
agent/core/tools/base.py,sha256=CdzRFNuOjNfzgyTUN4ZoCGkUDR5HI0ECQVpvrUdEij8,2295
|
|
15
|
+
agent/core/tools/bash.py,sha256=jnJKVlHn8np8e0gWd8EO0_qqjMkfQzutSugA_Iol4jE,1585
|
|
16
|
+
agent/core/tools/collection.py,sha256=NuwTn6dXSyznxWodfmFDQwUlxxaGb4oBPym4AEJABSQ,1338
|
|
17
|
+
agent/core/tools/computer.py,sha256=lT_aW3huoYpcM8kffuokELupSz_WZG_qkaW1gITRC58,3892
|
|
18
|
+
agent/core/tools/edit.py,sha256=kv4jTKCM0VXrnoNErf7mT-xlr81-7T8v49_VA9y_L4Y,2005
|
|
19
|
+
agent/core/tools/manager.py,sha256=IRsCXjGc076nncQuyIjODoafnHTDhrf9sP5B4q5Pcdo,1742
|
|
20
|
+
agent/providers/__init__.py,sha256=b4tIBAaIB1V7p8V0BWipHVnMhfHH_OuVgP4OWGSHdD8,194
|
|
21
|
+
agent/providers/anthropic/__init__.py,sha256=vEqLDkYXZoXg9A64bOtWfv9hoJlJCXbTpQGcmQ9eec8,149
|
|
22
|
+
agent/providers/anthropic/api/client.py,sha256=_DeCn6bYgVG0LcQYDO6VCjTPrt6U-PO5vr4GWmhCPH8,7404
|
|
23
|
+
agent/providers/anthropic/api/logging.py,sha256=vHpwkIyOZdkSTVIH4ycbBPd4a_rzhP7Osu1I-Ayouwc,5154
|
|
24
|
+
agent/providers/anthropic/callbacks/manager.py,sha256=dRKN7MuBze2dLal0iHDxCKYqMdh_KShSphuwn7zC-c4,1878
|
|
25
|
+
agent/providers/anthropic/loop.py,sha256=GfUU_0erZgaM8oENSbrKEepsYsYTfuOiygcjHK0pefY,17904
|
|
26
|
+
agent/providers/anthropic/messages/manager.py,sha256=atD41v6bjC1STxRB-jLBty9wHlMwacH9cwsL4tBz3uo,4891
|
|
27
|
+
agent/providers/anthropic/prompts.py,sha256=nHFfgPrfvnWrEdVP7EUBGUHAI85D2X9HeZirk9EwncU,1941
|
|
28
|
+
agent/providers/anthropic/tools/__init__.py,sha256=JyZwuVtPUnZwRSZBSCdQv9yxbLCsygm3l8Ywjjt9qTQ,661
|
|
29
|
+
agent/providers/anthropic/tools/base.py,sha256=B1oKv9syFv_JNuCybpllf1PxO8D7ZVtt6C-uoP-GYgw,2799
|
|
30
|
+
agent/providers/anthropic/tools/bash.py,sha256=CIh4pO0jEdSZApnjpmFhrQbTTiwxivuOgv1-QLN0Ydw,5740
|
|
31
|
+
agent/providers/anthropic/tools/collection.py,sha256=8RzHLobL44_Jjt8ltXS6I8XJlEAQOfc75dmnDUaHE-8,922
|
|
32
|
+
agent/providers/anthropic/tools/computer.py,sha256=WnQS2rIIDz1juwoQMun2ODJjOV134tiZRKOyFzLmshk,24900
|
|
33
|
+
agent/providers/anthropic/tools/edit.py,sha256=EGRP61MDA4Oue1D7Q-_vLpd6LdGbdBA1Z4HSZ66DbmI,13465
|
|
34
|
+
agent/providers/anthropic/tools/manager.py,sha256=zW-biqO_MV3fb1nDEOl3EmCXD1leoglFj6LDRSM3djs,1982
|
|
35
|
+
agent/providers/anthropic/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
|
|
36
|
+
agent/providers/anthropic/types.py,sha256=kKc4XvSuKfumv4KLpJOwyY4t5deBsLgZTSAP4raZGvg,421
|
|
37
|
+
agent/providers/omni/__init__.py,sha256=wKOVVWHkD-p4QUz0TIEENkMb7Iq2LRSh88KUGBW1XQA,744
|
|
38
|
+
agent/providers/omni/callbacks.py,sha256=ZG9NCgsHWt6y5jKsfcGLaoLxTpmKnIhCArDdeP4q9sA,2369
|
|
39
|
+
agent/providers/omni/clients/anthropic.py,sha256=X_QRVxqwA_ExdUqgBEwo1aHOfZQxVIBDmDugNHF97OM,3554
|
|
40
|
+
agent/providers/omni/clients/base.py,sha256=zAAgPi0jl3SWPC730R9l79E8bfYPSo39UtCSE-mrK6I,1076
|
|
41
|
+
agent/providers/omni/clients/groq.py,sha256=HEinpE0_Cp_-geMyjJ8qaTPl0regPtETPkem4U13qG4,3599
|
|
42
|
+
agent/providers/omni/clients/openai.py,sha256=E4TAXMUFoYTunJETCWCNx5XAc6xutiN4rB6PlVpzC5s,5972
|
|
43
|
+
agent/providers/omni/clients/utils.py,sha256=Ani9CVVBm_J2Dl51WG6p1GVuoI6cq8scISrG0pmQ37o,688
|
|
44
|
+
agent/providers/omni/experiment.py,sha256=JGAdHi7Nf73I48c9k3TY1Xpr_i6D2VG1wurOzw5cNGk,9888
|
|
45
|
+
agent/providers/omni/image_utils.py,sha256=qIFuNi5cIMVwrqYBXG1T6PxUlbxz7gIngFFP39bZIlU,2782
|
|
46
|
+
agent/providers/omni/loop.py,sha256=Xr2QeedAVJ_jHn3KMopRuH3mrm2Qn4ncxKjqj9hWxAw,43577
|
|
47
|
+
agent/providers/omni/messages.py,sha256=6LkQfzYDWq2FvIHpqhs5pc0l6AmFx_xKCjj1R5czMPo,6047
|
|
48
|
+
agent/providers/omni/parser.py,sha256=Iv-cXWG2qzdYjyZJH5pGUzfv6nOaiHQ2OXdQSe00Ydw,9151
|
|
49
|
+
agent/providers/omni/prompts.py,sha256=29qy8ppbLOjLil3aiqryjaiBf8CQx-xXHN44O-85Q00,4503
|
|
50
|
+
agent/providers/omni/tool_manager.py,sha256=O6DxyEI-Vg6jt99phh011o4q4me_vNhH2YffIxkO4GM,2585
|
|
51
|
+
agent/providers/omni/tools/__init__.py,sha256=l636hx9Q5z9eaFdPanPwPENUE-w-Xm8kAZhPUq0ZQF4,309
|
|
52
|
+
agent/providers/omni/tools/bash.py,sha256=y_ibfP9iRcbiU_E0faAoa4DCP_BlkMlKOOURdBBIGZE,2030
|
|
53
|
+
agent/providers/omni/tools/computer.py,sha256=xkMmAR0e_kbf0Zs2mggCDyWrQOJZyXOKPFjkutaQb94,9108
|
|
54
|
+
agent/providers/omni/tools/manager.py,sha256=V_tav2yU92PyQnFlxNXG1wvNEaJoEYudtKx5sRjj06Q,2619
|
|
55
|
+
agent/providers/omni/types.py,sha256=cEH6M5fcRN8ZIv_jfcYkTYboGBM4EzglLZo1_Xk7Ip8,800
|
|
56
|
+
agent/providers/omni/utils.py,sha256=JqSye1bEp4wxhUgmaMyZi172fTlgXtygJ7XlnvKdUtE,6337
|
|
57
|
+
agent/providers/omni/visualization.py,sha256=N3qVQLxYmia3iSVC5oCt5YRlMPuVfylCOyB99R33u8U,3924
|
|
58
|
+
agent/types/__init__.py,sha256=61UFJT-w0CT4YRn0LiTx4A7fsMdVQjlXO9vnmbI1A7Y,604
|
|
59
|
+
agent/types/base.py,sha256=rVb4mPWp1SOHfrzOCDqx0pfCV5bgIsdrIzgM_kX_xVs,1090
|
|
60
|
+
agent/types/messages.py,sha256=4-hwtxeAhto90_EZpHFducddtsHUsHauvXzYrpKG4RE,953
|
|
61
|
+
agent/types/tools.py,sha256=Jes2CFCFqC727WWHbO-sG7V03rBHnQe5X7Oi9ZkuScI,877
|
|
62
|
+
cua_agent-0.1.0.dist-info/METADATA,sha256=Q4nPzYL_UQwx82vuaRLBUFmA_Sgd37TVoGA9FNYDRmU,1890
|
|
63
|
+
cua_agent-0.1.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
64
|
+
cua_agent-0.1.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
65
|
+
cua_agent-0.1.0.dist-info/RECORD,,
|