daytona-use-computer 0.0.48__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.
- daytona_use_computer-0.0.48.dist-info/METADATA +197 -0
- daytona_use_computer-0.0.48.dist-info/RECORD +58 -0
- daytona_use_computer-0.0.48.dist-info/WHEEL +4 -0
- use_computer/__init__.py +58 -0
- use_computer/agents/__init__.py +52 -0
- use_computer/agents/action_manifest.json +40 -0
- use_computer/agents/base/__init__.py +31 -0
- use_computer/agents/base/actions.py +282 -0
- use_computer/agents/base/agent.py +275 -0
- use_computer/agents/base/artifacts.py +90 -0
- use_computer/agents/base/desktop.py +147 -0
- use_computer/agents/base/final_state.py +136 -0
- use_computer/agents/base/prompts.py +44 -0
- use_computer/agents/base/recordings.py +162 -0
- use_computer/agents/base/sandbox.py +7 -0
- use_computer/agents/base/screenshots.py +52 -0
- use_computer/agents/base/task_setup.py +273 -0
- use_computer/agents/base/trajectory.py +34 -0
- use_computer/agents/core.py +65 -0
- use_computer/agents/debug/README.md +10 -0
- use_computer/agents/debug/__init__.py +5 -0
- use_computer/agents/debug/actions.py +89 -0
- use_computer/agents/debug/agent.py +205 -0
- use_computer/agents/debug/models.py +88 -0
- use_computer/agents/prompts/anthropic.txt +7 -0
- use_computer/agents/prompts/gemini.txt +6 -0
- use_computer/agents/prompts/openai.txt +7 -0
- use_computer/agents/prompts/osworld_pyautogui.txt +18 -0
- use_computer/agents/prompts/pyautogui.txt +50 -0
- use_computer/agents/providers/__init__.py +1 -0
- use_computer/agents/providers/anthropic.py +316 -0
- use_computer/agents/providers/gemini.py +413 -0
- use_computer/agents/providers/generic.py +620 -0
- use_computer/agents/providers/openai.py +363 -0
- use_computer/agents/providers/osworld.py +229 -0
- use_computer/agents/providers/tinker_backend.py +163 -0
- use_computer/agents/types.py +204 -0
- use_computer/automation/__init__.py +28 -0
- use_computer/automation/ax_transpile.py +504 -0
- use_computer/automation/osworld.py +466 -0
- use_computer/automation/parsers.py +307 -0
- use_computer/core/__init__.py +51 -0
- use_computer/core/client.py +421 -0
- use_computer/core/errors.py +112 -0
- use_computer/core/models.py +132 -0
- use_computer/core/retry.py +140 -0
- use_computer/core/sandbox.py +514 -0
- use_computer/macos/__init__.py +4 -0
- use_computer/macos/keyboard.py +73 -0
- use_computer/macos/mouse.py +207 -0
- use_computer/py.typed +1 -0
- use_computer/resources/__init__.py +20 -0
- use_computer/resources/accessibility.py +39 -0
- use_computer/resources/display.py +39 -0
- use_computer/resources/permissions.py +59 -0
- use_computer/resources/recording.py +98 -0
- use_computer/resources/screenshot.py +63 -0
- use_computer/setup_files.py +55 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: daytona-use-computer
|
|
3
|
+
Version: 0.0.48
|
|
4
|
+
Summary: Python SDK for use.computer macOS sandboxes
|
|
5
|
+
Project-URL: Homepage, https://use.computer
|
|
6
|
+
Project-URL: Documentation, https://api.use.computer/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/daytona/use-computer-sdk
|
|
8
|
+
Author: use.computer
|
|
9
|
+
Keywords: automation,computer-use,macos,sandbox,vnc
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: httpx>=0.27
|
|
21
|
+
Provides-Extra: agents
|
|
22
|
+
Requires-Dist: anthropic>=0.86; extra == 'agents'
|
|
23
|
+
Requires-Dist: google-genai>=1; extra == 'agents'
|
|
24
|
+
Requires-Dist: litellm>=1; extra == 'agents'
|
|
25
|
+
Requires-Dist: openai>=1; extra == 'agents'
|
|
26
|
+
Requires-Dist: pillow>=10; extra == 'agents'
|
|
27
|
+
Requires-Dist: tinker-cookbook>=0.1.0; (python_full_version >= '3.11') and extra == 'agents'
|
|
28
|
+
Requires-Dist: tinker>=0.14.0; (python_full_version >= '3.11') and extra == 'agents'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# use-computer Python SDK (`daytona-use-computer`)
|
|
32
|
+
|
|
33
|
+
use.computer gives you macOS sandboxes: VMs on dedicated Apple M4 Mac minis that you reserve for 24 hours or more, up to 2 VMs at a time per Mac.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install daytona-use-computer
|
|
37
|
+
export USE_COMPUTER_API_KEY=uc_live_...
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Optional agent integrations are installed explicitly:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install "daytona-use-computer[agents]" # computer-use agents and provider SDKs
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Base installs only the SDK client and `httpx`. The `agents` extra installs the agent runtime plus model-provider dependencies (Anthropic, OpenAI, Gemini, LiteLLM).
|
|
47
|
+
|
|
48
|
+
## Quickstart
|
|
49
|
+
|
|
50
|
+
Flow: sign up → $100 starter credit → reserve a Mac mini (dashboard, or `client.reserve(hours=24)` in the SDK) → `create()` a macOS sandbox → drive it (mouse, keyboard, screenshot, exec, files, recording, UI tree, VNC) → `delete()`. Reservations cost $1.91/hour per Mac; the starter credit pays for them.
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from use_computer import Computer
|
|
54
|
+
|
|
55
|
+
client = Computer()
|
|
56
|
+
|
|
57
|
+
# 1. Reserve one M4 Mac Mini for 24 hours
|
|
58
|
+
reservation = client.reserve(hours=24, mac_model="m4")
|
|
59
|
+
|
|
60
|
+
# 2. Launch a macOS sandbox on the reserved Mac
|
|
61
|
+
with client.create(reservation_id=reservation.id) as mac:
|
|
62
|
+
# 3. Drive the macOS sandbox
|
|
63
|
+
mac.exec("open -a Safari")
|
|
64
|
+
mac.keyboard.type("hello from use.computer")
|
|
65
|
+
mac.mouse.click(500, 500)
|
|
66
|
+
png = mac.screenshot.take_full_screen()
|
|
67
|
+
print("Sandbox:", mac.sandbox_id)
|
|
68
|
+
# Open this sandbox's viewer from the use.computer dashboard.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Never print or share `vnc_url`: it contains your account API key. Open the viewer from the dashboard instead.
|
|
72
|
+
|
|
73
|
+
The optional `mac_model` picks the Mac: `"m4"` (the default; 10 vCPU and 16 GiB RAM) or `"m4-pro"` (12 or more vCPU and 24 GiB RAM). `reservation.mac_model` reports it.
|
|
74
|
+
|
|
75
|
+
Each `create()` can set `cpu`, `memory_gib`, and `disk_gib`. Omitted fields use the Mac's warm VM size, which is 5 vCPU and 8 GiB RAM today and starts right away. Any other size boots a new VM, which can take up to 5 minutes, so `create()` waits up to 10 minutes when you set any of them. A Mac runs at most 2 sandboxes at a time, and their sizes must fit in the Mac. The sandbox reports `cpu`, `memory_gib`, `disk_gib`, and `boot` (`"warm"` or `"cold"`):
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
with client.create(reservation_id=reservation.id, cpu=8, memory_gib=12) as mac:
|
|
79
|
+
print(mac.cpu, mac.memory_gib, mac.boot)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If the size does not fit, `create()` raises `SandboxResourcesError`. Its `code` is `invalid_resources`, `resources_exceed_mac`, `sandbox_limit_reached`, or `insufficient_capacity`, and its `message` explains the refusal. `AsyncComputer` accepts the same options. Check `Computer().platforms(reservation_id=...)["macos"]["capacity"]` for the selected reservation's `max` and `used` counts.
|
|
83
|
+
|
|
84
|
+
The older `vm_layout` reservation option still works but is deprecated; the SDK sends it only when you pass it. `"split"` (the server default) allows two sandboxes, and `"whole"` allows one sandbox at a time.
|
|
85
|
+
|
|
86
|
+
When `ephemeral` is omitted, the server default is the reservation lifetime. Explicit `ephemeral=True` opts into destruction after 2 idle minutes; call `sandbox.start_keepalive(interval=30)` during long model-think periods. Explicit `ephemeral=False` disables idle destruction. Context managers still delete their sandbox on exit.
|
|
87
|
+
|
|
88
|
+
This default applies to the source release documented here. Published Python 0.0.46
|
|
89
|
+
still defaults to `ephemeral=True`; pass `ephemeral=False` explicitly on that
|
|
90
|
+
version. The next tagged release includes the omitted-field default above.
|
|
91
|
+
|
|
92
|
+
## Computer actions
|
|
93
|
+
|
|
94
|
+
Coordinates use screenshot pixels. `mouse.click(x, y, button="middle")` selects the
|
|
95
|
+
middle button; `click_count=3` sends one native triple-click sequence.
|
|
96
|
+
`mouse.down()` / `mouse.up()` hold and release the left button at the current
|
|
97
|
+
cursor, with optional `button`, `x`, and `y`. `keyboard.hold("shift", 0.5)` holds
|
|
98
|
+
keys for seconds. `mouse.drag(..., path=[{"x": 10, "y": 20}, ...])` preserves all
|
|
99
|
+
path points. `mouse.scroll(x, y, scroll_x=40, scroll_y=-80)` sends both pixel
|
|
100
|
+
deltas (positive right/down); the direction/amount form remains available.
|
|
101
|
+
The async methods have the same arguments.
|
|
102
|
+
|
|
103
|
+
Provider mappings are recorded in
|
|
104
|
+
[`action_manifest.json`](use_computer/agents/action_manifest.json).
|
|
105
|
+
Anthropic tool pixels are scaled to sandbox pixels; Gemini uses normalized
|
|
106
|
+
0..999 coordinates. Control and Command remain distinct. Invalid actions and
|
|
107
|
+
gateway errors are not reported as executed.
|
|
108
|
+
|
|
109
|
+
Agent logs separate action execution from `settle+screenshot`: the latter
|
|
110
|
+
includes a deliberate two-second settle, screenshot requests, and any recovery.
|
|
111
|
+
These are not model inference timings or raw screenshot latency.
|
|
112
|
+
|
|
113
|
+
`exec(command, timeout=120)` uses the gateway's non-login `/bin/zsh -c`;
|
|
114
|
+
`exec_ax` uses `/bin/sh` through the desktop server. The timeout is seconds
|
|
115
|
+
and is sent to the gateway and used as the HTTP timeout. For a 200-second
|
|
116
|
+
command, use `timeout=300`. Results retain separate stdout, stderr, and
|
|
117
|
+
`return_code`; a nonzero process exit is not an HTTP transport failure.
|
|
118
|
+
|
|
119
|
+
## Application automation permissions
|
|
120
|
+
|
|
121
|
+
macOS asks for consent when a process sends Apple events to another application
|
|
122
|
+
through AppleScript or `osascript`. That consent dialog cannot be answered inside
|
|
123
|
+
the sandbox. The gateway approves every installed application when creating a
|
|
124
|
+
sandbox or restoring a snapshot. After installing another app, call
|
|
125
|
+
`sandbox.permissions.allow_automation()` to approve it before scripting it:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
# Inside an async macOS sandbox session:
|
|
129
|
+
result = await sandbox.exec("brew install --cask firefox")
|
|
130
|
+
if result.return_code != 0:
|
|
131
|
+
raise RuntimeError(result.stderr)
|
|
132
|
+
approval = await sandbox.permissions.allow_automation(
|
|
133
|
+
bundle_ids=["org.mozilla.firefox"]
|
|
134
|
+
)
|
|
135
|
+
print(approval.success, approval.targets, approval.changed)
|
|
136
|
+
|
|
137
|
+
# Alternatively, approve all currently installed applications:
|
|
138
|
+
approval = await sandbox.permissions.allow_automation(installed=True)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The synchronous `MacOSSandbox` exposes the same method without `await`.
|
|
142
|
+
Approvals cover Apple events sent through `osascript`, SSH sessions, `exec`, and
|
|
143
|
+
Terminal.
|
|
144
|
+
|
|
145
|
+
`allow_automation(bundle_ids=None, installed=False)` sends
|
|
146
|
+
`POST /v1/sandboxes/{sandboxID}/permissions/automation`. Supply specific
|
|
147
|
+
`bundle_ids`, `installed=True` for all installed applications, or both in one
|
|
148
|
+
call. Omitted bundle IDs and the default `installed=False` are not sent.
|
|
149
|
+
The 200 response is decoded as the exported `AutomationApproval` dataclass:
|
|
150
|
+
`success: bool`, `targets: int` (applications considered), and `changed: int`
|
|
151
|
+
(approvals added or flipped from denied).
|
|
152
|
+
|
|
153
|
+
The gateway validates bundle IDs against
|
|
154
|
+
`^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$`. Malformed IDs or an empty request receive
|
|
155
|
+
HTTP 400 with `{"error": ...}`. The SDK does not validate them locally; it raises
|
|
156
|
+
the standard `httpx.HTTPStatusError`, whose `response` retains the status and
|
|
157
|
+
error body.
|
|
158
|
+
|
|
159
|
+
## Runtime Snapshots
|
|
160
|
+
|
|
161
|
+
macOS snapshots let you seed a VM once, snapshot it, then create new sandboxes from that snapshot version. macOS snapshots preserve disk state, so installed apps, accounts, and seeded files are available immediately:
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
from use_computer import Computer
|
|
165
|
+
|
|
166
|
+
client = Computer()
|
|
167
|
+
|
|
168
|
+
# Configure the macOS desktop by hand over VNC, then snapshot it.
|
|
169
|
+
with client.create(type="macos") as mac:
|
|
170
|
+
print("Configure sandbox in the dashboard viewer:", mac.sandbox_id)
|
|
171
|
+
input("Press Enter once the desktop is ready to snapshot...")
|
|
172
|
+
snapshot = mac.snapshot("chrome-seeded-macos")
|
|
173
|
+
|
|
174
|
+
# New sandboxes boot from that saved disk state, no setup needed.
|
|
175
|
+
with client.create(type="macos", snapshot=snapshot.version) as seeded:
|
|
176
|
+
print("Seeded sandbox ready:", seeded.sandbox_id)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Use `client.snapshots()` to list saved snapshot versions.
|
|
180
|
+
|
|
181
|
+
## Examples
|
|
182
|
+
|
|
183
|
+
| File | What it shows |
|
|
184
|
+
| --- | --- |
|
|
185
|
+
| [`examples/_1_hello_macos.py`](../examples/python/_1_hello_macos.py) | reserve → create → exec → keyboard → screenshot |
|
|
186
|
+
| [`examples/_2_recording.py`](../examples/python/_2_recording.py) | start / stop / download a screen recording |
|
|
187
|
+
| [`examples/_3_file_transfer.py`](../examples/python/_3_file_transfer.py) | upload bytes, download a file back |
|
|
188
|
+
| [`examples/_4_keepalive.py`](../examples/python/_4_keepalive.py) | heartbeat for ephemeral sessions idle > 2 min |
|
|
189
|
+
| [`examples/_5_snapshots.py`](../examples/python/_5_snapshots.py) | snapshot seeded macOS state |
|
|
190
|
+
|
|
191
|
+
## HTTP API
|
|
192
|
+
|
|
193
|
+
Every SDK method wraps `https://api.use.computer/v1/...` with `Authorization: Bearer uc_live_...`. Swagger: [api.use.computer/docs](https://api.use.computer/docs). OpenAPI spec: [api.use.computer/openapi.yaml](https://api.use.computer/openapi.yaml).
|
|
194
|
+
|
|
195
|
+
Gateway URLs, whether passed explicitly or via `USE_COMPUTER_BASE_URL`, must use HTTPS except for loopback HTTP. The SDK does not load `.env` files by default; load one explicitly in your application if needed. Authenticated requests, including keepalive and agent reference screenshots, do not follow redirects.
|
|
196
|
+
|
|
197
|
+
Lifecycle calls (`reserve`, `create`, and `snapshot`, including restores via `create(snapshot=...)`) send a fresh UUID v4 `Idempotency-Key` per call. Idempotent HTTP methods and keyed lifecycle mutations retry transient failures using the same key and body; unkeyed mutations are not retried. A new lifecycle method invocation is a new intent with a new key.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
use_computer/__init__.py,sha256=MJDAjH5gBRCK4XAw-Y6hukzPJ39efmF2VAP1zAaGy_U,1355
|
|
2
|
+
use_computer/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
+
use_computer/setup_files.py,sha256=oEKvx0hr8PSFMBhQZ58QtPg5gaK5zuoCj1MwTfSRJ-E,1552
|
|
4
|
+
use_computer/agents/__init__.py,sha256=X1J76U0qfdoh-JudGHhrxdnMCRJJGrvVXwek2iDkcfI,1968
|
|
5
|
+
use_computer/agents/action_manifest.json,sha256=Ztvb3IWP4DsbJxsXsQgus-t6XG_VlBaOIZwM9ESbnKk,3492
|
|
6
|
+
use_computer/agents/core.py,sha256=nqYxLpemx75oG1ZzsXNRwFgicvjye6hBTDq-GwmjOz8,1613
|
|
7
|
+
use_computer/agents/types.py,sha256=EbaD5UbtTTTXD4jVHcTz6--Ct8nUgOWpIxTaAgyOTXM,6099
|
|
8
|
+
use_computer/agents/base/__init__.py,sha256=E20b25cDAjlPEwJG4sO58G1RzO4oTPGWgABVLWki78M,939
|
|
9
|
+
use_computer/agents/base/actions.py,sha256=gvoYkXMMRWxHX8sGtOfqOpUepaJ7BSisERslEBO2Oh0,11320
|
|
10
|
+
use_computer/agents/base/agent.py,sha256=-DYpjCOC-D9XE9im3HfNnilswBuRk-VrO0wT6Q2ylaU,10565
|
|
11
|
+
use_computer/agents/base/artifacts.py,sha256=b9f3Anul1VbAkhhWc4ygJ30YE2_FT5oEvBelylv3Jfs,3504
|
|
12
|
+
use_computer/agents/base/desktop.py,sha256=dyZ_YGOPXeiwsz-L4kqoPWaALYkdGVyOUzuBxaV38rE,3678
|
|
13
|
+
use_computer/agents/base/final_state.py,sha256=Fl4ppFO5t5L6kKBwJJMD7igXVX3b29iAub3jT_-xU0Q,5252
|
|
14
|
+
use_computer/agents/base/prompts.py,sha256=rajDoTQY2Cd8F2vLYH6Pi4jH_dJlb85Yc5hl5uhJ8XE,1413
|
|
15
|
+
use_computer/agents/base/recordings.py,sha256=qq4QdBAFmyk0qvzjtbSTxEnx6kTHnN7LfgqQ8sxQWA4,6352
|
|
16
|
+
use_computer/agents/base/sandbox.py,sha256=ORol50XgG0RA8dnDE5ElDBAr6kxUg2hNNZ0TEKKATpE,184
|
|
17
|
+
use_computer/agents/base/screenshots.py,sha256=KUmhmcyDhqrAdnqPzlrB0VoPlaiFMPugqhBOM2U2HLA,1902
|
|
18
|
+
use_computer/agents/base/task_setup.py,sha256=eCJxoYgiaMIvo3c8oCGEOr5nPLHbkDLZHhWunqrkuW0,9060
|
|
19
|
+
use_computer/agents/base/trajectory.py,sha256=o9KRnAu4MdQFQyIUwovmT2OUAMjp6YHZ6OYGLZ6Zvog,849
|
|
20
|
+
use_computer/agents/debug/README.md,sha256=POF_k8QxWf6-1-0QXbOq6rnHfIL-SBauWXv8WGWeF08,454
|
|
21
|
+
use_computer/agents/debug/__init__.py,sha256=9mHCYf-5WXw0Qf3FRceUtoY7bOI_eausfS1PxxCNWlE,157
|
|
22
|
+
use_computer/agents/debug/actions.py,sha256=eFpL-aF5hXROY6Md0LJ_LWYWIwWUlGiuMNE1pXrltIU,3368
|
|
23
|
+
use_computer/agents/debug/agent.py,sha256=px76iqvPFUt2o-OXN4Rkn3fdZnJk5mlbj3d4RZkv81c,7357
|
|
24
|
+
use_computer/agents/debug/models.py,sha256=i1uUnnBciOJR-pN1UEoE0XAsYXGiiSR16TREJUyF1CM,2615
|
|
25
|
+
use_computer/agents/prompts/anthropic.txt,sha256=BXWzYsYG0MZ439tZONID9JXP-2OyFg1Yfu_yOUzRREg,521
|
|
26
|
+
use_computer/agents/prompts/gemini.txt,sha256=aZGjx2b_s_eGeYiGZyxI7Q6tZlzxzBpB1pv8YdRU_lU,356
|
|
27
|
+
use_computer/agents/prompts/openai.txt,sha256=BXWzYsYG0MZ439tZONID9JXP-2OyFg1Yfu_yOUzRREg,521
|
|
28
|
+
use_computer/agents/prompts/osworld_pyautogui.txt,sha256=R7tCB8GXq1uwSB7VfzmjLupzZTypgKj4r9oYqZQ2t2U,1896
|
|
29
|
+
use_computer/agents/prompts/pyautogui.txt,sha256=-WEM_I9IqRKriIe-HQke71gGDm_rrvTUAjoxPKiXUZs,2558
|
|
30
|
+
use_computer/agents/providers/__init__.py,sha256=9Rc7haJ7X__mklzPkQYWxRagyBfmJv0lG_yh2nNQCKI,75
|
|
31
|
+
use_computer/agents/providers/anthropic.py,sha256=WU2Xz9kcQu2Qo9hh8UWGF060pk626A0Yi7tq7g4Csnw,12066
|
|
32
|
+
use_computer/agents/providers/gemini.py,sha256=rFHnPXkBz8XaX-o3cdRfMTRBo9NHaVsl8GKZyBTJGpQ,15818
|
|
33
|
+
use_computer/agents/providers/generic.py,sha256=wcTRjUzJxuO8BAOioo6WexXW-kbMScAHojRI98DWx5U,22102
|
|
34
|
+
use_computer/agents/providers/openai.py,sha256=sEWXXY-XEQ53M7NQtK_HtFZ1chXhUskxNEFBq_3PHg0,12371
|
|
35
|
+
use_computer/agents/providers/osworld.py,sha256=0BTuCDBeoN-jk-aLEaXLT4TZT2kbsFLeFyfetr49Qao,7709
|
|
36
|
+
use_computer/agents/providers/tinker_backend.py,sha256=Xz7WW3JBB4sIoBJ8WPM5e6_IYcQDp85_kuaRc3E-IRU,6422
|
|
37
|
+
use_computer/automation/__init__.py,sha256=ObAF_vOnDN7zQOSWRI5RkeSaM3Szq980dIZtKSoLKpI,746
|
|
38
|
+
use_computer/automation/ax_transpile.py,sha256=p0vWzDrIcCjteeRIqrBnk7c4wdRI5BgzcBYQmDVHL10,18607
|
|
39
|
+
use_computer/automation/osworld.py,sha256=WIH-zrJtUnJ9QYqTEEdR8Wg4iQ2EAFBhq0dXTl8zxno,17785
|
|
40
|
+
use_computer/automation/parsers.py,sha256=apQQxkTrJbySRYwRAsvYuidu7_f7JqAfvzW4MOx0L08,9368
|
|
41
|
+
use_computer/core/__init__.py,sha256=OAfgVoYbRunhI4nhO5RTlT8LHkFMhHFdVDyWhNyKV-Q,1109
|
|
42
|
+
use_computer/core/client.py,sha256=NHBdNJZRXHjzF9fqwAwTLJX4LL2r8P-_OwjeunU165o,14396
|
|
43
|
+
use_computer/core/errors.py,sha256=mq9NDbx-9BZKH_NIQFfz31mPx3NvAz6AxbeHSMr1esc,3701
|
|
44
|
+
use_computer/core/models.py,sha256=eDTIRno27mcxKc2n8vwN0KYva8FQTLN3bmfkuUzNZ-E,3170
|
|
45
|
+
use_computer/core/retry.py,sha256=oX_V5GURBEkMo4MosoB9AzItktcOj8l6LUIJuc0-DYE,4594
|
|
46
|
+
use_computer/core/sandbox.py,sha256=T-j4dK4IlPCG7PnzRTr_Q6e99L9dspFuCqSnLtht0go,17357
|
|
47
|
+
use_computer/macos/__init__.py,sha256=lMsFdDRTsmoVz6jKtlijVsKaA2H9eqTqkKrNx4t8jpQ,183
|
|
48
|
+
use_computer/macos/keyboard.py,sha256=XjGAojVqSRA8gbviTRMfYrHjDLMNs8bzaYaErgSD0RI,2796
|
|
49
|
+
use_computer/macos/mouse.py,sha256=M8rboCduyJsozKgJMjxO-xubviLeuMMol2tH4ITx1pg,6896
|
|
50
|
+
use_computer/resources/__init__.py,sha256=vV5Fe9sSwbJLEaU1O1RKkKNZ36OdHAV-L1woTRikiew,630
|
|
51
|
+
use_computer/resources/accessibility.py,sha256=G50lwUcyEi0FeuacEAxLWykY-OmqanasYiwKGTwN5PM,1543
|
|
52
|
+
use_computer/resources/display.py,sha256=F6F1kBhVS3N7zhThsqaro8yrtIOttiITJCdxSBE7jeg,1137
|
|
53
|
+
use_computer/resources/permissions.py,sha256=uH7QHaSax98HFj1mfZMSMCcRmRk9NPjMVWvPs3pE8l4,2404
|
|
54
|
+
use_computer/resources/recording.py,sha256=6B8qg8346DADTZzI_EEehQFcy5Bbr6UGQNlT-KEoE7Q,3864
|
|
55
|
+
use_computer/resources/screenshot.py,sha256=8AhbSOA647KqPNB6YhOjLunOiM9c9aYL14hwxnPPin0,2229
|
|
56
|
+
daytona_use_computer-0.0.48.dist-info/METADATA,sha256=Nf37s8GUeyMFFCMgE1HXvxsAZZHeQMNwjWmXSjpMQcI,10616
|
|
57
|
+
daytona_use_computer-0.0.48.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
58
|
+
daytona_use_computer-0.0.48.dist-info/RECORD,,
|
use_computer/__init__.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from use_computer.automation.osworld import AsyncOSWorldClient, OSWorldClient
|
|
2
|
+
from use_computer.automation.parsers import Action, parse_pyautogui, parse_xdotool
|
|
3
|
+
from use_computer.core.client import AsyncComputer, Computer, Reservation
|
|
4
|
+
from use_computer.core.errors import (
|
|
5
|
+
BillingRequiredError,
|
|
6
|
+
PlatformNotSupportedError,
|
|
7
|
+
ReservationRequiredError,
|
|
8
|
+
SandboxResourcesError,
|
|
9
|
+
UseComputerError,
|
|
10
|
+
)
|
|
11
|
+
from use_computer.core.models import (
|
|
12
|
+
AccessibilityTree,
|
|
13
|
+
ActionResult,
|
|
14
|
+
ActResult,
|
|
15
|
+
AutomationApproval,
|
|
16
|
+
CursorPosition,
|
|
17
|
+
DisplayInfo,
|
|
18
|
+
ExecResult,
|
|
19
|
+
RecordingInfo,
|
|
20
|
+
)
|
|
21
|
+
from use_computer.core.sandbox import (
|
|
22
|
+
AsyncMacOSSandbox,
|
|
23
|
+
AsyncSandbox,
|
|
24
|
+
MacOSSandbox,
|
|
25
|
+
Sandbox,
|
|
26
|
+
SandboxType,
|
|
27
|
+
Snapshot,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"Action",
|
|
32
|
+
"AccessibilityTree",
|
|
33
|
+
"ActionResult",
|
|
34
|
+
"ActResult",
|
|
35
|
+
"AsyncComputer",
|
|
36
|
+
"AsyncMacOSSandbox",
|
|
37
|
+
"AsyncOSWorldClient",
|
|
38
|
+
"AsyncSandbox",
|
|
39
|
+
"AutomationApproval",
|
|
40
|
+
"BillingRequiredError",
|
|
41
|
+
"Computer",
|
|
42
|
+
"CursorPosition",
|
|
43
|
+
"DisplayInfo",
|
|
44
|
+
"ExecResult",
|
|
45
|
+
"MacOSSandbox",
|
|
46
|
+
"OSWorldClient",
|
|
47
|
+
"PlatformNotSupportedError",
|
|
48
|
+
"RecordingInfo",
|
|
49
|
+
"Reservation",
|
|
50
|
+
"ReservationRequiredError",
|
|
51
|
+
"Sandbox",
|
|
52
|
+
"SandboxResourcesError",
|
|
53
|
+
"SandboxType",
|
|
54
|
+
"Snapshot",
|
|
55
|
+
"UseComputerError",
|
|
56
|
+
"parse_pyautogui",
|
|
57
|
+
"parse_xdotool",
|
|
58
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Optional computer-use agents.
|
|
2
|
+
|
|
3
|
+
Install provider-backed agents with `daytona-use-computer[agents]`.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from importlib import import_module
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
from use_computer.agents.core import AgentRunOptions, AgentRunResult, AgentUsage
|
|
12
|
+
|
|
13
|
+
_LAZY_EXPORTS = {
|
|
14
|
+
"AnthropicComputerAgent": (
|
|
15
|
+
"use_computer.agents.providers.anthropic",
|
|
16
|
+
"AnthropicComputerAgent",
|
|
17
|
+
),
|
|
18
|
+
"AnthropicCUAAgent": ("use_computer.agents.providers.anthropic", "AnthropicCUAAgent"),
|
|
19
|
+
"DebugComputerAgent": ("use_computer.agents.debug.agent", "DebugComputerAgent"),
|
|
20
|
+
"DebugCUAAgent": ("use_computer.agents.debug.agent", "DebugCUAAgent"),
|
|
21
|
+
"GeminiComputerAgent": ("use_computer.agents.providers.gemini", "GeminiComputerAgent"),
|
|
22
|
+
"GeminiCUAAgent": ("use_computer.agents.providers.gemini", "GeminiCUAAgent"),
|
|
23
|
+
"GenericComputerAgent": ("use_computer.agents.providers.generic", "GenericComputerAgent"),
|
|
24
|
+
"GenericCUAAgent": ("use_computer.agents.providers.generic", "GenericCUAAgent"),
|
|
25
|
+
"OpenAIComputerAgent": ("use_computer.agents.providers.openai", "OpenAIComputerAgent"),
|
|
26
|
+
"OpenAICUAAgent": ("use_computer.agents.providers.openai", "OpenAICUAAgent"),
|
|
27
|
+
"OSWorldAgent": ("use_computer.agents.providers.osworld", "OSWorldAgent"),
|
|
28
|
+
"OSWorldComputerAgent": ("use_computer.agents.providers.osworld", "OSWorldComputerAgent"),
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"AgentRunOptions",
|
|
33
|
+
"AgentRunResult",
|
|
34
|
+
"AgentUsage",
|
|
35
|
+
*_LAZY_EXPORTS,
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __getattr__(name: str) -> Any:
|
|
40
|
+
target = _LAZY_EXPORTS.get(name)
|
|
41
|
+
if target is None:
|
|
42
|
+
raise AttributeError(name)
|
|
43
|
+
module_name, attr = target
|
|
44
|
+
try:
|
|
45
|
+
module = import_module(module_name)
|
|
46
|
+
except ModuleNotFoundError as exc:
|
|
47
|
+
raise ModuleNotFoundError(
|
|
48
|
+
f"{name} requires optional agent dependencies. Install `daytona-use-computer[agents]`."
|
|
49
|
+
) from exc
|
|
50
|
+
value = getattr(module, attr)
|
|
51
|
+
globals()[name] = value
|
|
52
|
+
return value
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"route_prefix": "/v1/sandboxes/{id}",
|
|
4
|
+
"status": "implemented; real production GUI proof pending",
|
|
5
|
+
"coordinates": {"gateway": "screenshot pixels", "anthropic": "1280x800 tool pixels scaled independently by screenshot_width/1280 and screenshot_height/800", "openai": "screenshot pixels", "gemini": "floor(coord/1000*screen_dimension), input 0..999"},
|
|
6
|
+
"anthropic": {
|
|
7
|
+
"key": {"routes": ["POST /keyboard/press", "POST /keyboard/hotkey"], "emulation": "normalize aliases; plus-separated combo uses hotkey"},
|
|
8
|
+
"hold_key": {"routes": ["POST /keyboard/hold"], "payload": "keys=text, duration=seconds"},
|
|
9
|
+
"type": {"routes": ["POST /keyboard/type"]},
|
|
10
|
+
"mouse_move": {"routes": ["POST /mouse/move"]},
|
|
11
|
+
"left_mouse_down": {"routes": ["POST /mouse/down"]},
|
|
12
|
+
"left_mouse_up": {"routes": ["POST /mouse/up"]},
|
|
13
|
+
"left_click": {"routes": ["POST /mouse/click"], "payload": "button=left"},
|
|
14
|
+
"left_click_drag": {"routes": ["GET /mouse/position", "POST /mouse/drag"], "emulation": "current cursor is start when start_coordinate omitted"},
|
|
15
|
+
"right_click": {"routes": ["POST /mouse/click"], "payload": "button=right"},
|
|
16
|
+
"middle_click": {"routes": ["POST /mouse/click"], "payload": "button=middle"},
|
|
17
|
+
"double_click": {"routes": ["POST /mouse/click"], "payload": "double=true"},
|
|
18
|
+
"triple_click": {"routes": ["POST /mouse/click"], "payload": "click_count=3"},
|
|
19
|
+
"scroll": {"routes": ["POST /mouse/scroll"], "payload": "direction=scroll_direction, amount=scroll_amount"},
|
|
20
|
+
"cursor_position": {"routes": ["GET /mouse/position"], "emulation": "Anthropic provider divides gateway coordinates by tool-to-screen scale before reporting"}
|
|
21
|
+
},
|
|
22
|
+
"openai": {
|
|
23
|
+
"click": {"routes": ["POST /mouse/click"], "buttons": {"left":"left", "right":"right", "wheel":"middle"}},
|
|
24
|
+
"double_click": {"routes": ["POST /mouse/click"], "payload": "double=true"},
|
|
25
|
+
"drag": {"routes": ["POST /mouse/drag"], "payload": "path preserves every {x,y} point in order"},
|
|
26
|
+
"keypress": {"routes": ["POST /keyboard/press", "POST /keyboard/hotkey"], "emulation": "join keys with + and normalize aliases"},
|
|
27
|
+
"scroll": {"routes": ["POST /mouse/scroll"], "payload": "scroll_x and scroll_y retained; positive right/down"},
|
|
28
|
+
"type": {"routes": ["POST /keyboard/type"]},
|
|
29
|
+
"move": {"routes": ["POST /mouse/move"]}
|
|
30
|
+
},
|
|
31
|
+
"gemini": {
|
|
32
|
+
"click_at": {"routes": ["POST /mouse/click"]},
|
|
33
|
+
"hover_at": {"routes": ["POST /mouse/move"]},
|
|
34
|
+
"type_text_at": {"routes": ["POST /mouse/click", "POST /keyboard/hotkey", "POST /keyboard/press", "POST /keyboard/type"], "emulation": "click focus; command+a and Delete unless clear_before_typing=false; type; optional Return"},
|
|
35
|
+
"key_combination": {"routes": ["POST /keyboard/press", "POST /keyboard/hotkey"]},
|
|
36
|
+
"scroll_at": {"routes": ["POST /mouse/scroll"], "payload": "magnitude default800 denormalized by affected screen dimension; direction signed into scroll_x/scroll_y", "reference": "https://github.com/google/computer-use-preview/blob/main/agent.py"},
|
|
37
|
+
"drag_and_drop": {"routes": ["POST /mouse/drag"], "payload": "from_x/from_y/to_x/to_y"}
|
|
38
|
+
},
|
|
39
|
+
"notes": ["Coordinate-free clicks and scroll first GET /mouse/position.", "Actions except cursor_position are followed by a two-second settle and screenshot; timing label settle+screenshot includes both.", "Control remains Control, never rewritten to Command.", "Unknown actions return Invalid action, never executed; gateway HTTP errors are reported as failed."]
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Public base-agent surface for CUA agents."""
|
|
2
|
+
|
|
3
|
+
from use_computer.agents.base.actions import _annotate_click, execute_action
|
|
4
|
+
from use_computer.agents.base.agent import BaseCUAAgent
|
|
5
|
+
from use_computer.agents.base.desktop import (
|
|
6
|
+
DesktopProfile,
|
|
7
|
+
OpenAIComputerEnvironment,
|
|
8
|
+
desktop_profile,
|
|
9
|
+
)
|
|
10
|
+
from use_computer.agents.base.prompts import build_system_prompt, load_prompt
|
|
11
|
+
from use_computer.agents.base.sandbox import ComputerSandbox
|
|
12
|
+
from use_computer.agents.base.screenshots import (
|
|
13
|
+
scale_screenshot_for_model,
|
|
14
|
+
screenshot_cap_for_model,
|
|
15
|
+
)
|
|
16
|
+
from use_computer.agents.base.trajectory import write_trajectory
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"BaseCUAAgent",
|
|
20
|
+
"ComputerSandbox",
|
|
21
|
+
"DesktopProfile",
|
|
22
|
+
"OpenAIComputerEnvironment",
|
|
23
|
+
"_annotate_click",
|
|
24
|
+
"build_system_prompt",
|
|
25
|
+
"desktop_profile",
|
|
26
|
+
"execute_action",
|
|
27
|
+
"load_prompt",
|
|
28
|
+
"scale_screenshot_for_model",
|
|
29
|
+
"screenshot_cap_for_model",
|
|
30
|
+
"write_trajectory",
|
|
31
|
+
]
|