computer-use-ootb-internal 0.0.109.post2__py3-none-any.whl → 0.0.110__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.
@@ -1,40 +1,40 @@
1
- """
2
- Test script to verify cursor animation is working
3
- """
4
- import asyncio
5
- import sys
6
- import time
7
- from pathlib import Path
8
- from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
9
-
10
- async def test_animations():
11
-
12
- # Initialize the computer tool
13
- computer = ComputerTool()
14
-
15
- # Test mouse move animation
16
- print("Testing mouse move animation...")
17
- await computer(action="mouse_move_windll", coordinate=(500, 500))
18
- print("Waiting 2 seconds...")
19
- await asyncio.sleep(2)
20
-
21
- # Test click animation
22
- print("Testing click animation...")
23
- await computer(action="left_click_windll", coordinate=(700, 300))
24
- print("Waiting 2 seconds...")
25
- await asyncio.sleep(2)
26
-
27
- # Test another move
28
- print("Testing move and click sequence...")
29
- await computer(action="mouse_move_windll", coordinate=(300, 300))
30
- await asyncio.sleep(1)
31
- await computer(action="left_click_windll", coordinate=(300, 300))
32
-
33
- # Wait for animations to complete
34
- print("Waiting for animations to complete...")
35
- await asyncio.sleep(3)
36
-
37
- print("Test completed")
38
-
39
- if __name__ == "__main__":
1
+ """
2
+ Test script to verify cursor animation is working
3
+ """
4
+ import asyncio
5
+ import sys
6
+ import time
7
+ from pathlib import Path
8
+ from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
9
+
10
+ async def test_animations():
11
+
12
+ # Initialize the computer tool
13
+ computer = ComputerTool()
14
+
15
+ # Test mouse move animation
16
+ print("Testing mouse move animation...")
17
+ await computer(action="mouse_move_windll", coordinate=(500, 500))
18
+ print("Waiting 2 seconds...")
19
+ await asyncio.sleep(2)
20
+
21
+ # Test click animation
22
+ print("Testing click animation...")
23
+ await computer(action="left_click_windll", coordinate=(700, 300))
24
+ print("Waiting 2 seconds...")
25
+ await asyncio.sleep(2)
26
+
27
+ # Test another move
28
+ print("Testing move and click sequence...")
29
+ await computer(action="mouse_move_windll", coordinate=(300, 300))
30
+ await asyncio.sleep(1)
31
+ await computer(action="left_click_windll", coordinate=(300, 300))
32
+
33
+ # Wait for animations to complete
34
+ print("Waiting for animations to complete...")
35
+ await asyncio.sleep(3)
36
+
37
+ print("Test completed")
38
+
39
+ if __name__ == "__main__":
40
40
  asyncio.run(test_animations())
@@ -0,0 +1,194 @@
1
+ import sys
2
+ import os
3
+ import winreg
4
+ import ctypes
5
+ import platform
6
+ import shutil
7
+ import subprocess
8
+ import pathlib
9
+
10
+ REG_PATH = r"Software\Microsoft\Windows\CurrentVersion\Run"
11
+ APP_NAME = "OOTBLite" # Or a more specific name for your app's startup entry
12
+ # The package name as installed by pip
13
+ PACKAGE_NAME = "computer-use-ootb-internal"
14
+ # The main module to run at startup
15
+ STARTUP_MODULE = "computer_use_ootb_internal.app_teachmode"
16
+ # Name for the scheduled task
17
+ TASK_NAME = "OOTBLite_AutoUpdate"
18
+
19
+ def is_admin():
20
+ """Check if the script is running with administrative privileges."""
21
+ try:
22
+ return ctypes.windll.shell32.IsUserAnAdmin()
23
+ except:
24
+ return False
25
+
26
+ def get_python_executable():
27
+ """Gets the quoted path to the current python executable."""
28
+ python_exe = sys.executable
29
+ if " " in python_exe and not python_exe.startswith('"'):
30
+ python_exe = f'"{python_exe}"'
31
+ return python_exe
32
+
33
+ def get_pip_executable():
34
+ """Tries to locate the pip executable in the same environment."""
35
+ python_path = pathlib.Path(sys.executable)
36
+ # Common location is ../Scripts/pip.exe relative to python.exe
37
+ pip_path = python_path.parent / "Scripts" / "pip.exe"
38
+ if pip_path.exists():
39
+ # Quote if necessary
40
+ pip_exe = str(pip_path)
41
+ if " " in pip_exe and not pip_exe.startswith('"'):
42
+ pip_exe = f'"{pip_exe}"'
43
+ return pip_exe
44
+ else:
45
+ # Fallback: try using 'python -m pip'
46
+ print("Warning: pip.exe not found in Scripts directory. Falling back to 'python -m pip'.", file=sys.stderr)
47
+ return f"{get_python_executable()} -m pip"
48
+
49
+ def run_powershell_command(command):
50
+ """Executes a PowerShell command and handles output/errors."""
51
+ try:
52
+ # Use powershell.exe - it's more universally available than pwsh.exe
53
+ # capture_output=True suppresses output unless there's an error
54
+ # text=True decodes output/error streams
55
+ # check=True raises CalledProcessError on non-zero exit codes
56
+ result = subprocess.run(
57
+ ["powershell.exe", "-NoProfile", "-Command", command],
58
+ capture_output=True, text=True, check=True, encoding='utf-8'
59
+ )
60
+ print(f"PowerShell command executed successfully.")
61
+ if result.stdout:
62
+ print("Output:\n", result.stdout)
63
+ return True
64
+ except FileNotFoundError:
65
+ print("Error: 'powershell.exe' not found. Cannot manage scheduled tasks.", file=sys.stderr)
66
+ return False
67
+ except subprocess.CalledProcessError as e:
68
+ print(f"Error executing PowerShell command:", file=sys.stderr)
69
+ print(f" Command: {e.cmd}", file=sys.stderr)
70
+ print(f" Exit Code: {e.returncode}", file=sys.stderr)
71
+ print(f" Stderr: {e.stderr}", file=sys.stderr)
72
+ print(f" Stdout: {e.stdout}", file=sys.stderr)
73
+ return False
74
+ except Exception as e:
75
+ print(f"An unexpected error occurred running PowerShell: {e}", file=sys.stderr)
76
+ return False
77
+
78
+
79
+ def configure_startup():
80
+ """Adds the application to Windows startup and sets up auto-update task."""
81
+ if platform.system() != "Windows":
82
+ print("Error: This utility is only for Windows.", file=sys.stderr)
83
+ sys.exit(1)
84
+
85
+ if not is_admin():
86
+ print("Error: This utility requires administrative privileges.", file=sys.stderr)
87
+ print("Please run this command from an Administrator Command Prompt or PowerShell.", file=sys.stderr)
88
+ sys.exit(1)
89
+
90
+ # 1. Configure Registry for Startup
91
+ print("Configuring registry for application startup...")
92
+ python_exe = get_python_executable()
93
+ startup_command = f'{python_exe} -m {STARTUP_MODULE}'
94
+ try:
95
+ key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH)
96
+ winreg.SetValueEx(key, APP_NAME, 0, winreg.REG_SZ, startup_command)
97
+ winreg.CloseKey(key)
98
+ print(f"Success: Registry key HKLM\{REG_PATH}\{APP_NAME} set.")
99
+ print(f" Command: {startup_command}")
100
+ except OSError as e:
101
+ print(f"Error: Failed to set registry key HKLM\{REG_PATH}\{APP_NAME}", file=sys.stderr)
102
+ print(f"Details: {e}", file=sys.stderr)
103
+ # Continue to task setup even if registry fails? Or exit? Let's exit for now.
104
+ sys.exit(1)
105
+ except Exception as e:
106
+ print(f"An unexpected error occurred setting registry key: {e}", file=sys.stderr)
107
+ sys.exit(1)
108
+
109
+ # 2. Configure Scheduled Task for Auto-Update
110
+ print("\nConfiguring scheduled task for automatic updates...")
111
+ pip_command = get_pip_executable()
112
+ if not pip_command:
113
+ print("Error: Could not determine pip command. Skipping scheduled task setup.", file=sys.stderr)
114
+ sys.exit(1) # Exit if we can't find pip
115
+
116
+ update_command_args = f'install --upgrade --no-cache-dir {PACKAGE_NAME}'
117
+ # Need to handle quoting args for PowerShell if pip_command includes python.exe
118
+ pip_exe_path = pip_command.split()[0]
119
+ if "-m pip" in pip_command:
120
+ ps_args = f"-m pip {update_command_args}"
121
+ else:
122
+ ps_args = update_command_args
123
+
124
+ # PowerShell commands to create the task
125
+ # Define Action, Trigger, Principal, Settings, and then Register
126
+ # Note: Escaping quotes for PowerShell within Python string
127
+ # Ensure executable path and arguments are properly quoted for PowerShell
128
+ # Use triple-double quotes for f-strings containing single-quoted PowerShell strings
129
+ action = f"""$Action = New-ScheduledTaskAction -Execute '{pip_exe_path}' -Argument '{ps_args.replace("'", "''")}'""" # Escape single quotes in args for PS string
130
+ # Trigger: Daily, repeat every hour indefinitely
131
+ trigger = f"""$Trigger = New-ScheduledTaskTrigger -Daily -At 3am; $Trigger.Repetition.Interval = 'PT1H'; $Trigger.Repetition.Duration = 'P10675199D'""" # Using large duration for 'indefinitely'
132
+ # Principal: Run as SYSTEM user
133
+ principal = f"""$Principal = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest"""
134
+ # Settings: Allow start if on batteries, don't stop if goes off batteries (adjust as needed)
135
+ settings = f"""$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable""" # Added StartWhenAvailable
136
+
137
+ # Register Task: Use -Force to overwrite if it exists
138
+ description = f"Hourly check for {PACKAGE_NAME} updates."
139
+ # Escape single quotes in description just in case PACKAGE_NAME contains them
140
+ escaped_description = description.replace("'", "''")
141
+ register_command = f"""{action}; {trigger}; {principal}; {settings}; Register-ScheduledTask -TaskName '{TASK_NAME}' -Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings -Force -Description '{escaped_description}'"""
142
+
143
+ print(f"Attempting to create/update scheduled task '{TASK_NAME}'...")
144
+ if run_powershell_command(register_command):
145
+ print(f"Success: Scheduled task '{TASK_NAME}' created/updated.")
146
+ print(f" Task Action: {pip_exe_path} {ps_args}")
147
+ else:
148
+ print(f"Error: Failed to configure scheduled task '{TASK_NAME}'. Please check PowerShell errors above.", file=sys.stderr)
149
+ # Decide if failure here is critical
150
+ # sys.exit(1)
151
+
152
+
153
+ def remove_startup():
154
+ """Removes the application from Windows startup and removes auto-update task."""
155
+ if platform.system() != "Windows":
156
+ print("Error: This utility is only for Windows.", file=sys.stderr)
157
+ sys.exit(1)
158
+
159
+ if not is_admin():
160
+ print("Error: This utility requires administrative privileges.", file=sys.stderr)
161
+ print("Please run this command from an Administrator Command Prompt or PowerShell.", file=sys.stderr)
162
+ sys.exit(1)
163
+
164
+ # 1. Remove Registry Key
165
+ print("Removing registry key...")
166
+ try:
167
+ key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH, 0, winreg.KEY_WRITE)
168
+ winreg.DeleteValue(key, APP_NAME)
169
+ winreg.CloseKey(key)
170
+ print(f"Success: Registry key HKLM\{REG_PATH}\{APP_NAME} removed.")
171
+ except FileNotFoundError:
172
+ print(f"Info: Registry key HKLM\{REG_PATH}\{APP_NAME} not found. No action taken.")
173
+ except OSError as e:
174
+ print(f"Error: Failed to delete registry key HKLM\{REG_PATH}\{APP_NAME}", file=sys.stderr)
175
+ print(f"Details: {e}", file=sys.stderr)
176
+ # Continue to task removal
177
+ except Exception as e:
178
+ print(f"An unexpected error occurred removing registry key: {e}", file=sys.stderr)
179
+ # Continue to task removal
180
+
181
+ # 2. Remove Scheduled Task
182
+ print(f"\nRemoving scheduled task '{TASK_NAME}'...")
183
+ # Use -ErrorAction SilentlyContinue for Unregister-ScheduledTask if it might not exist
184
+ # Use triple-double quotes for f-string
185
+ unregister_command = f"""Unregister-ScheduledTask -TaskName '{TASK_NAME}' -Confirm:$false -ErrorAction SilentlyContinue"""
186
+
187
+ if run_powershell_command(unregister_command):
188
+ print(f"Success: Scheduled task '{TASK_NAME}' removed (if it existed).")
189
+ else:
190
+ print(f"Error: Failed to remove scheduled task '{TASK_NAME}'. Please check PowerShell errors above.", file=sys.stderr)
191
+
192
+ if __name__ == '__main__':
193
+ print("This script provides startup and auto-update configuration utilities.")
194
+ print("Use 'ootb-configure-startup' or 'ootb-remove-startup' as Administrator after installation.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.109.post2
3
+ Version: 0.0.110
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -14,15 +14,14 @@ Requires-Dist: matplotlib
14
14
  Requires-Dist: opencv-python
15
15
  Requires-Dist: pre-commit==3.8.0
16
16
  Requires-Dist: pyautogui==0.9.54
17
- Requires-Dist: pyside6
18
17
  Requires-Dist: pytest-asyncio==0.23.6
19
18
  Requires-Dist: pytest==8.3.3
20
- Requires-Dist: pywinauto
19
+ Requires-Dist: pywinauto; sys_platform == 'win32'
21
20
  Requires-Dist: ruff==0.6.7
22
21
  Requires-Dist: screeninfo
23
22
  Requires-Dist: streamlit>=1.38.0
24
23
  Requires-Dist: textdistance
25
- Requires-Dist: uiautomation
24
+ Requires-Dist: uiautomation; sys_platform == 'win32'
26
25
  Provides-Extra: dev
27
26
  Requires-Dist: pytest-asyncio>=0.23.6; extra == 'dev'
28
27
  Requires-Dist: pytest>=8.3.3; extra == 'dev'
@@ -1,12 +1,14 @@
1
1
  computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6Grub7li4,31
2
- computer_use_ootb_internal/app_teachmode.py,sha256=Yb5LtyaW4agGsfTmVvnIAkERXILkg3KkUZf7yI1dW-g,19253
2
+ computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
3
+ computer_use_ootb_internal/app_teachmode.py,sha256=-PQVCIi-6mkJ8vbyEenTPnCDYgu7R33ci_kFY7Ccfbw,18771
3
4
  computer_use_ootb_internal/app_teachmode_gradio.py,sha256=cmFpBrkdlZxOQADWveVdIaaNqaBD8IVs-xNLJogU7F8,7909
4
5
  computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
5
6
  computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
6
7
  computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=7Dj0iY4GG7P03tRKYJ2x9Yvt-PE-b7uyjCAed3SaF3Y,7086
8
+ computer_use_ootb_internal/startup_utils.py,sha256=JXu_13YuVdCUVJHgLoSyQV-tHy7qGEYgyPOyVgoxva4,9334
7
9
  computer_use_ootb_internal/computer_use_demo/animation/click_animation.py,sha256=tP1gsayFy-CKk10UlrE9RlexwlHWiHQUe5Ogg4vQvSg,3234
8
10
  computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif,sha256=4LfwsfFQnREXrNRs32aJU2jO65JXianJoL_8q7-8elg,30966
9
- computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=SOJz2yffXTkjuAHqk0IZLcMriR0KQYTo7W1b8wGyRGY,1222
11
+ computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=2R1u98OLKYalSZ5nt5vvyZ71FL5R5vLv-n8zM8jVdV8,1183
10
12
  computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=TBp_rXSAuHFBmZYyyIFca404c4v5LG1ZVbNaQpuvtzQ,16656
11
13
  computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py,sha256=h2CNeuACklxVpJC65QR8_6AvSybEZLmeO45hY_-lLBs,61
12
14
  computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=CxFJbsSb68ERKH7-C4RaaZy7FIhhzrzGx5qQJ4C37cA,13907
@@ -29,7 +31,7 @@ computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py,sha256=zZu
29
31
  computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQqFP3ZwlthWdqNkn7WETeTHeB6-o98c,11486
30
32
  computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
31
33
  computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
32
- computer_use_ootb_internal-0.0.109.post2.dist-info/METADATA,sha256=jTj_Um-WzpFJjLXIQ_iK6veWsvkwPcuvJ5p4GTC0vCA,916
33
- computer_use_ootb_internal-0.0.109.post2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- computer_use_ootb_internal-0.0.109.post2.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
35
- computer_use_ootb_internal-0.0.109.post2.dist-info/RECORD,,
34
+ computer_use_ootb_internal-0.0.110.dist-info/METADATA,sha256=VApESAleeSZz-CoNCaWHkEC9WFHl-Nb5qfa6MUC3bIw,937
35
+ computer_use_ootb_internal-0.0.110.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
+ computer_use_ootb_internal-0.0.110.dist-info/entry_points.txt,sha256=XOxhaseEddM9LaMoWFupcavxn5jMU7kMrLyrmcfc_bQ,255
37
+ computer_use_ootb_internal-0.0.110.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ computer-use-ootb-internal = computer_use_ootb_internal.app_teachmode:main
3
+ ootb-configure-startup = computer_use_ootb_internal.startup_utils:configure_startup
4
+ ootb-remove-startup = computer_use_ootb_internal.startup_utils:remove_startup
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- computer-use-ootb-internal = computer_use_ootb_internal.app_teachmode:main