cua-computer 0.1.23__py3-none-any.whl → 0.1.24__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.
@@ -7,6 +7,9 @@ NavigationKey = Literal['pagedown', 'pageup', 'home', 'end', 'left', 'right', 'u
7
7
  # Special key literals
8
8
  SpecialKey = Literal['enter', 'esc', 'tab', 'space', 'backspace', 'del']
9
9
 
10
+ # Modifier key literals
11
+ ModifierKey = Literal['ctrl', 'alt', 'shift', 'win', 'command', 'option']
12
+
10
13
  # Function key literals
11
14
  FunctionKey = Literal['f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12']
12
15
 
@@ -35,6 +38,14 @@ class Key(Enum):
35
38
  BACKSPACE = 'backspace'
36
39
  DELETE = 'del'
37
40
 
41
+ # Modifier keys
42
+ ALT = 'alt'
43
+ CTRL = 'ctrl'
44
+ SHIFT = 'shift'
45
+ WIN = 'win'
46
+ COMMAND = 'command'
47
+ OPTION = 'option'
48
+
38
49
  # Function keys
39
50
  F1 = 'f1'
40
51
  F2 = 'f2'
@@ -73,14 +84,27 @@ class Key(Enum):
73
84
  'escape': cls.ESCAPE,
74
85
  'esc': cls.ESC,
75
86
  'delete': cls.DELETE,
76
- 'del': cls.DELETE
87
+ 'del': cls.DELETE,
88
+ # Modifier key mappings
89
+ 'alt': cls.ALT,
90
+ 'ctrl': cls.CTRL,
91
+ 'control': cls.CTRL,
92
+ 'shift': cls.SHIFT,
93
+ 'win': cls.WIN,
94
+ 'windows': cls.WIN,
95
+ 'super': cls.WIN,
96
+ 'command': cls.COMMAND,
97
+ 'cmd': cls.COMMAND,
98
+ '⌘': cls.COMMAND,
99
+ 'option': cls.OPTION,
100
+ '⌥': cls.OPTION,
77
101
  }
78
102
 
79
103
  normalized = key.lower().strip()
80
104
  return key_mapping.get(normalized, key)
81
105
 
82
106
  # Combined key type
83
- KeyType = Union[Key, NavigationKey, SpecialKey, FunctionKey, str]
107
+ KeyType = Union[Key, NavigationKey, SpecialKey, ModifierKey, FunctionKey, str]
84
108
 
85
109
  class AccessibilityWindow(TypedDict):
86
110
  """Information about a window in the accessibility tree."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cua-computer
3
- Version: 0.1.23
3
+ Version: 0.1.24
4
4
  Summary: Computer-Use Interface (CUI) framework powering Cua
5
5
  Author-Email: TryCua <gh@trycua.com>
6
6
  Requires-Python: >=3.10
@@ -85,30 +85,78 @@ Refer to this notebook for a step-by-step guide on how to use the Computer-Use I
85
85
 
86
86
  ## Using the Gradio Computer UI
87
87
 
88
- The computer module includes a Gradio UI for creating and sharing demonstration data. The UI provides built-in integration with Hugging Face Datasets for sharing demonstrations and incorporating them into CUA ML pipelines.
88
+ The computer module includes a Gradio UI for creating and sharing demonstration data. We make it easy for people to build community datasets for better computer use models with an upload to Huggingface feature.
89
89
 
90
90
  ```bash
91
91
  # Install with UI support
92
92
  pip install "cua-computer[ui]"
93
93
  ```
94
94
 
95
+ > **Note:** For precise control of the computer, we recommend using VNC or Screen Sharing instead of the Computer Gradio UI.
95
96
 
96
- <details open>
97
- <summary>View demonstration video</summary>
98
- <video src="https://github.com/user-attachments/assets/7c683b58-f04d-4e8c-b63f-6ef36e9637d5" controls width="600"></video>
99
- </details>
97
+ ### Building and Sharing Demonstrations with Huggingface
100
98
 
101
- > **Note:** For precise control of the computer, we recommend using VNC or Screen Sharing instead of the Computer Gradio UI.
99
+ Follow these steps to contribute your own demonstrations:
100
+
101
+ #### 1. Set up Huggingface Access
102
102
 
103
+ Set your HF_TOKEN in a .env file or in your environment variables:
104
+
105
+ ```bash
106
+ # In .env file
107
+ HF_TOKEN=your_huggingface_token
108
+ ```
103
109
 
104
- ### Launch the UI
110
+ #### 2. Launch the Computer UI
105
111
 
106
112
  ```python
107
113
  # launch_ui.py
108
114
  from computer.ui.gradio.app import create_gradio_ui
115
+ from dotenv import load_dotenv
116
+ load_dotenv('.env')
109
117
 
110
118
  app = create_gradio_ui()
111
119
  app.launch(share=False)
112
120
  ```
113
121
 
114
122
  For examples, see [Computer UI Examples](../../examples/computer_ui_examples.py)
123
+
124
+ #### 3. Record Your Tasks
125
+
126
+ <details open>
127
+ <summary>View demonstration video</summary>
128
+ <video src="https://github.com/user-attachments/assets/de3c3477-62fe-413c-998d-4063e48de176" controls width="600"></video>
129
+ </details>
130
+
131
+ Record yourself performing various computer tasks using the UI.
132
+
133
+ #### 4. Save Your Demonstrations
134
+
135
+ <details open>
136
+ <summary>View demonstration video</summary>
137
+ <video src="https://github.com/user-attachments/assets/5ad1df37-026a-457f-8b49-922ae805faef" controls width="600"></video>
138
+ </details>
139
+
140
+ Save each task by picking a descriptive name and adding relevant tags (e.g., "office", "web-browsing", "coding").
141
+
142
+ #### 5. Record Additional Demonstrations
143
+
144
+ Repeat steps 3 and 4 until you have a good amount of demonstrations covering different tasks and scenarios.
145
+
146
+ #### 6. Upload to Huggingface
147
+
148
+ <details open>
149
+ <summary>View demonstration video</summary>
150
+ <video src="https://github.com/user-attachments/assets/c586d460-3877-4b5f-a736-3248886d2134" controls width="600"></video>
151
+ </details>
152
+
153
+ Upload your dataset to Huggingface by:
154
+ - Naming it as `{your_username}/{dataset_name}`
155
+ - Choosing public or private visibility
156
+ - Optionally selecting specific tags to upload only tasks with certain tags
157
+
158
+ #### Examples and Resources
159
+
160
+ - Example Dataset: [ddupont/test-dataset](https://huggingface.co/datasets/ddupont/test-dataset)
161
+ - Find Community Datasets: 🔍 [Browse CUA Datasets on Huggingface](https://huggingface.co/datasets?other=cua)
162
+
@@ -5,7 +5,7 @@ computer/interface/base.py,sha256=MypCT28XGSITKcdMEpmxkIuE0IKeGLtl5c4v9btzc88,53
5
5
  computer/interface/factory.py,sha256=7Sczbmgu7Zlf9QfmhxOe_wFawRSPpvwd2dLSA4asDs0,1028
6
6
  computer/interface/linux.py,sha256=0Kc_vkPnEUlKUcVYMycbxiuKyZOpOPwwmUcFJbFmopE,817
7
7
  computer/interface/macos.py,sha256=08BTROfTTvYq7YjEzy1j3Jk_eJB_nYxtkbdPc8NySOQ,24545
8
- computer/interface/models.py,sha256=K9bSl6Ne_hStLq653gHgFLYB4_vuewtm2aVFojvnOwY,2570
8
+ computer/interface/models.py,sha256=RZKVUdwKrKUoFqwlx2Dk8Egkmq_AInlIu_d0xg7SZzw,3238
9
9
  computer/logger.py,sha256=UVvnmZGOWVF9TCsixEbeQnDZ3wBPAJ2anW3Zp-MoJ8Y,2896
10
10
  computer/models.py,sha256=6chs4wxMpWdVhsOETeaGqFFI3feBmSyLIC8l5EJDq5g,780
11
11
  computer/telemetry.py,sha256=FvNFpxgeRuCMdNpREuSL7bOMZy9gSzY4J0rLeNDw0CU,3746
@@ -13,7 +13,7 @@ computer/ui/__init__.py,sha256=pmo05ek9qiB_x7DPeE6Vf_8RsIOqTD0w1dBLMHfoOnY,45
13
13
  computer/ui/gradio/__init__.py,sha256=5_KimixM48-X74FCsLw7LbSt39MQfUMEL8-M9amK3Cw,117
14
14
  computer/ui/gradio/app.py,sha256=HKlVx9dvjcXkrUDq3EmRsfBOhZLBPzSxlYsaEN8Et_E,64081
15
15
  computer/utils.py,sha256=zY50NXB7r51GNLQ6l7lhG_qv0_ufpQ8n0-SDhCei8m4,2838
16
- cua_computer-0.1.23.dist-info/METADATA,sha256=6jZPeNpEXOuJ-iFUeMlXOvjnp2qe3umM7WYWLYXb5ok,3995
17
- cua_computer-0.1.23.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
18
- cua_computer-0.1.23.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
19
- cua_computer-0.1.23.dist-info/RECORD,,
16
+ cua_computer-0.1.24.dist-info/METADATA,sha256=ciHf85TAHOn6Ecuuztb5p7h96s-xVj_y-0NtF0W6wgU,5579
17
+ cua_computer-0.1.24.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
18
+ cua_computer-0.1.24.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
19
+ cua_computer-0.1.24.dist-info/RECORD,,