computer-use-ootb-internal 0.0.165__py3-none-any.whl → 0.0.167__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.
- computer_use_ootb_internal/app_teachmode.py +558 -558
- computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +39 -39
- computer_use_ootb_internal/computer_use_demo/tools/computer.py +7 -7
- computer_use_ootb_internal/guard_service.py +998 -922
- computer_use_ootb_internal/preparation/star_rail_prepare.py +99 -99
- computer_use_ootb_internal/run_teachmode_ootb_args.py +223 -223
- computer_use_ootb_internal/service_manager.py +194 -335
- computer_use_ootb_internal/signal_connection.py +47 -47
- computer_use_ootb_internal/test_click_0425.py +58 -0
- {computer_use_ootb_internal-0.0.165.dist-info → computer_use_ootb_internal-0.0.167.dist-info}/METADATA +8 -9
- {computer_use_ootb_internal-0.0.165.dist-info → computer_use_ootb_internal-0.0.167.dist-info}/RECORD +13 -13
- computer_use_ootb_internal-0.0.167.dist-info/entry_points.txt +2 -0
- computer_use_ootb_internal/launch_ootb_elevated.ps1 +0 -63
- computer_use_ootb_internal-0.0.165.dist-info/entry_points.txt +0 -4
- {computer_use_ootb_internal-0.0.165.dist-info → computer_use_ootb_internal-0.0.167.dist-info}/WHEEL +0 -0
@@ -1,48 +1,48 @@
|
|
1
|
-
# Helper script to signal guard service about user connection
|
2
|
-
# Save as e.g., ootb_lite_pypi/ootb_lite_pypi/src/computer_use_ootb_internal/signal_connection.py
|
3
|
-
import sys
|
4
|
-
import requests
|
5
|
-
import logging
|
6
|
-
import os
|
7
|
-
import pathlib
|
8
|
-
|
9
|
-
# Basic logging for the script itself
|
10
|
-
LOG_DIR = pathlib.Path(os.environ.get('PROGRAMDATA', 'C:/ProgramData')) / "OOTBGuardService" / "SignalLogs"
|
11
|
-
LOG_DIR.mkdir(parents=True, exist_ok=True)
|
12
|
-
LOG_FILE = LOG_DIR / "signal_connection.log"
|
13
|
-
|
14
|
-
logging.basicConfig(
|
15
|
-
filename=LOG_FILE,
|
16
|
-
level=logging.INFO,
|
17
|
-
format='%(asctime)s %(levelname)s: %(message)s'
|
18
|
-
)
|
19
|
-
|
20
|
-
GUARD_SERVICE_URL = "http://localhost:14000/internal/user_connected"
|
21
|
-
|
22
|
-
if __name__ == "__main__":
|
23
|
-
if len(sys.argv) < 2:
|
24
|
-
logging.error("Username argument missing.")
|
25
|
-
sys.exit(1)
|
26
|
-
|
27
|
-
username = sys.argv[1]
|
28
|
-
logging.info(f"Signaling connection for user: {username}")
|
29
|
-
|
30
|
-
payload = {"username": username}
|
31
|
-
|
32
|
-
try:
|
33
|
-
response = requests.post(GUARD_SERVICE_URL, json=payload, timeout=10)
|
34
|
-
response.raise_for_status()
|
35
|
-
logging.info(f"Successfully signaled connection for user {username}. Status: {response.status_code}")
|
36
|
-
sys.exit(0)
|
37
|
-
except requests.exceptions.ConnectionError:
|
38
|
-
logging.error(f"Connection refused when trying to signal for user {username}. Guard service might not be running or accessible.")
|
39
|
-
sys.exit(2)
|
40
|
-
except requests.exceptions.Timeout:
|
41
|
-
logging.error(f"Timeout when trying to signal for user {username}.")
|
42
|
-
sys.exit(3)
|
43
|
-
except requests.exceptions.RequestException as e:
|
44
|
-
logging.error(f"Error signaling connection for user {username}: {e}")
|
45
|
-
sys.exit(4)
|
46
|
-
except Exception as e:
|
47
|
-
logging.error(f"Unexpected error for user {username}: {e}")
|
1
|
+
# Helper script to signal guard service about user connection
|
2
|
+
# Save as e.g., ootb_lite_pypi/ootb_lite_pypi/src/computer_use_ootb_internal/signal_connection.py
|
3
|
+
import sys
|
4
|
+
import requests
|
5
|
+
import logging
|
6
|
+
import os
|
7
|
+
import pathlib
|
8
|
+
|
9
|
+
# Basic logging for the script itself
|
10
|
+
LOG_DIR = pathlib.Path(os.environ.get('PROGRAMDATA', 'C:/ProgramData')) / "OOTBGuardService" / "SignalLogs"
|
11
|
+
LOG_DIR.mkdir(parents=True, exist_ok=True)
|
12
|
+
LOG_FILE = LOG_DIR / "signal_connection.log"
|
13
|
+
|
14
|
+
logging.basicConfig(
|
15
|
+
filename=LOG_FILE,
|
16
|
+
level=logging.INFO,
|
17
|
+
format='%(asctime)s %(levelname)s: %(message)s'
|
18
|
+
)
|
19
|
+
|
20
|
+
GUARD_SERVICE_URL = "http://localhost:14000/internal/user_connected"
|
21
|
+
|
22
|
+
if __name__ == "__main__":
|
23
|
+
if len(sys.argv) < 2:
|
24
|
+
logging.error("Username argument missing.")
|
25
|
+
sys.exit(1)
|
26
|
+
|
27
|
+
username = sys.argv[1]
|
28
|
+
logging.info(f"Signaling connection for user: {username}")
|
29
|
+
|
30
|
+
payload = {"username": username}
|
31
|
+
|
32
|
+
try:
|
33
|
+
response = requests.post(GUARD_SERVICE_URL, json=payload, timeout=10)
|
34
|
+
response.raise_for_status()
|
35
|
+
logging.info(f"Successfully signaled connection for user {username}. Status: {response.status_code}")
|
36
|
+
sys.exit(0)
|
37
|
+
except requests.exceptions.ConnectionError:
|
38
|
+
logging.error(f"Connection refused when trying to signal for user {username}. Guard service might not be running or accessible.")
|
39
|
+
sys.exit(2)
|
40
|
+
except requests.exceptions.Timeout:
|
41
|
+
logging.error(f"Timeout when trying to signal for user {username}.")
|
42
|
+
sys.exit(3)
|
43
|
+
except requests.exceptions.RequestException as e:
|
44
|
+
logging.error(f"Error signaling connection for user {username}: {e}")
|
45
|
+
sys.exit(4)
|
46
|
+
except Exception as e:
|
47
|
+
logging.error(f"Unexpected error for user {username}: {e}")
|
48
48
|
sys.exit(5)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import pyautogui
|
2
|
+
import asyncio
|
3
|
+
import sys
|
4
|
+
import time
|
5
|
+
from pathlib import Path
|
6
|
+
from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
|
7
|
+
|
8
|
+
|
9
|
+
# pyautogui.keyDown("alt")
|
10
|
+
|
11
|
+
|
12
|
+
# pyautogui.click(x=1600, y=47)
|
13
|
+
# pyautogui.click(x=1600, y=47)
|
14
|
+
# pyautogui.keyUp("alt")
|
15
|
+
|
16
|
+
|
17
|
+
async def test_animations():
|
18
|
+
|
19
|
+
# Initialize the computer tool
|
20
|
+
computer = ComputerTool()
|
21
|
+
|
22
|
+
# # Test mouse move animation
|
23
|
+
print("Testing mouse move animation...")
|
24
|
+
# await computer(action="mouse_move_windll", coordinate=(1600, 500))
|
25
|
+
# print("Waiting 2 seconds...")
|
26
|
+
# await asyncio.sleep(2)
|
27
|
+
|
28
|
+
# # Test click animation
|
29
|
+
# print("Testing click animation...")
|
30
|
+
# await computer(action="left_click_windll", coordinate=(1600, 300))
|
31
|
+
# print("Waiting 2 seconds...")
|
32
|
+
# await asyncio.sleep(2)
|
33
|
+
|
34
|
+
# Test another move
|
35
|
+
print("Testing move and click sequence...")
|
36
|
+
await computer(action="key_down_windll", text='alt')
|
37
|
+
# pyautogui.keyDown('alt')
|
38
|
+
# await asyncio.sleep(1)
|
39
|
+
# await computer(action="mouse_move_windll", coordinate=(2550+1600, 45))
|
40
|
+
# await asyncio.sleep(1)
|
41
|
+
# await computer(action="left_click", coordinate=(2550+1600, 45))
|
42
|
+
await computer(action="mouse_move", coordinate=(1600, 45))
|
43
|
+
# pyautogui.keyDown('alt')
|
44
|
+
|
45
|
+
await computer(action="left_click", coordinate=(1600, 45))
|
46
|
+
# await computer(action="left_cl1ck_windll", coordinate=(2550+1600, 45))
|
47
|
+
await asyncio.sleep(1)
|
48
|
+
await computer(action="key_up_windll", text='alt')
|
49
|
+
# pyautogui.keyUp('alt')
|
50
|
+
|
51
|
+
# Wait for animations to comple1e
|
52
|
+
print("Waiting for animations to complete...")
|
53
|
+
await asyncio.sleep(3)
|
54
|
+
|
55
|
+
print("Test completed")
|
56
|
+
|
57
|
+
if __name__ == "__main__":
|
58
|
+
asyncio.run(test_animations())
|
@@ -1,30 +1,29 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: computer-use-ootb-internal
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.167
|
4
4
|
Summary: Computer Use OOTB
|
5
5
|
Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
|
6
6
|
Requires-Python: >=3.11
|
7
7
|
Requires-Dist: anthropic[bedrock,vertex]>=0.37.1
|
8
8
|
Requires-Dist: boto3>=1.28.57
|
9
|
-
Requires-Dist: flask>=2.0
|
10
9
|
Requires-Dist: google-auth<3,>=2
|
11
10
|
Requires-Dist: gradio>=5.6.0
|
12
11
|
Requires-Dist: jsonschema==4.22.0
|
13
12
|
Requires-Dist: litellm
|
14
13
|
Requires-Dist: matplotlib
|
15
14
|
Requires-Dist: opencv-python
|
16
|
-
Requires-Dist:
|
15
|
+
Requires-Dist: pre-commit==3.8.0
|
17
16
|
Requires-Dist: pyautogui==0.9.54
|
18
|
-
Requires-Dist:
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
17
|
+
Requires-Dist: pyside6
|
18
|
+
Requires-Dist: pytest-asyncio==0.23.6
|
19
|
+
Requires-Dist: pytest==8.3.3
|
20
|
+
Requires-Dist: pywinauto
|
21
|
+
Requires-Dist: ruff==0.6.7
|
21
22
|
Requires-Dist: screeninfo
|
22
23
|
Requires-Dist: streamlit>=1.38.0
|
23
24
|
Requires-Dist: textdistance
|
24
|
-
Requires-Dist: uiautomation
|
25
|
-
Requires-Dist: waitress>=2.0
|
25
|
+
Requires-Dist: uiautomation
|
26
26
|
Provides-Extra: dev
|
27
|
-
Requires-Dist: pre-commit>=3.8.0; extra == 'dev'
|
28
27
|
Requires-Dist: pytest-asyncio>=0.23.6; extra == 'dev'
|
29
28
|
Requires-Dist: pytest>=8.3.3; extra == 'dev'
|
30
29
|
Requires-Dist: ruff>=0.6.7; extra == 'dev'
|
{computer_use_ootb_internal-0.0.165.dist-info → computer_use_ootb_internal-0.0.167.dist-info}/RECORD
RENAMED
@@ -1,16 +1,16 @@
|
|
1
1
|
computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6Grub7li4,31
|
2
2
|
computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
3
|
-
computer_use_ootb_internal/app_teachmode.py,sha256=
|
3
|
+
computer_use_ootb_internal/app_teachmode.py,sha256=R4kLoII4dkRkOMVWZUIhD3h39nQkrnbYShQuT8Q966I,24363
|
4
4
|
computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
|
5
|
-
computer_use_ootb_internal/guard_service.py,sha256=
|
6
|
-
computer_use_ootb_internal/launch_ootb_elevated.ps1,sha256=cAigroRaV4CW1gw0SNaPemmeIBRM7bCCwNDHSN8KHkw,2364
|
5
|
+
computer_use_ootb_internal/guard_service.py,sha256=FZsztgGP4fG2U7aj8KhlbRE_gUoLuGnCW8393bMbpFs,54217
|
7
6
|
computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
|
8
|
-
computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=
|
9
|
-
computer_use_ootb_internal/service_manager.py,sha256=
|
10
|
-
computer_use_ootb_internal/signal_connection.py,sha256=
|
7
|
+
computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=ZYVxaOMxOOTZt2S-xmJcZqXmYqqIPl57tgheMO8OOBU,7910
|
8
|
+
computer_use_ootb_internal/service_manager.py,sha256=_aFUtvSbovX73PY1QE01RkaqGV6swJaStrOwcg_Df94,9928
|
9
|
+
computer_use_ootb_internal/signal_connection.py,sha256=e6eGByhb2Gx8HHJHrHM3HvchobSUmba1y7-YRB6L59E,1821
|
10
|
+
computer_use_ootb_internal/test_click_0425.py,sha256=uZtP6DsPVRFonKMYlbe9eHmPY6hH5y8xWgr2KxHC8E4,1808
|
11
11
|
computer_use_ootb_internal/computer_use_demo/animation/click_animation.py,sha256=tP1gsayFy-CKk10UlrE9RlexwlHWiHQUe5Ogg4vQvSg,3234
|
12
12
|
computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif,sha256=4LfwsfFQnREXrNRs32aJU2jO65JXianJoL_8q7-8elg,30966
|
13
|
-
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=
|
13
|
+
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=SOJz2yffXTkjuAHqk0IZLcMriR0KQYTo7W1b8wGyRGY,1222
|
14
14
|
computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=5fbEin5SDpchuCe6lEtRPK9JbO4YRqqIsD6LijJTrD8,16692
|
15
15
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py,sha256=h2CNeuACklxVpJC65QR8_6AvSybEZLmeO45hY_-lLBs,61
|
16
16
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=CxFJbsSb68ERKH7-C4RaaZy7FIhhzrzGx5qQJ4C37cA,13907
|
@@ -28,14 +28,14 @@ computer_use_ootb_internal/computer_use_demo/tools/base.py,sha256=XKG8UpjTvG3-Pl
|
|
28
28
|
computer_use_ootb_internal/computer_use_demo/tools/bash.py,sha256=rHetQ80_v-TTi-1oxIA7ncFEwJxFTh8FJCErIoZbGeY,4236
|
29
29
|
computer_use_ootb_internal/computer_use_demo/tools/collection.py,sha256=8RzHLobL44_Jjt8ltXS6I8XJlEAQOfc75dmnDUaHE-8,922
|
30
30
|
computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py,sha256=cvlmnhAImDTwoRRwhT5au7mNFhfAD7ZfeoDEVdVzDKw,892
|
31
|
-
computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=
|
31
|
+
computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=wzu__PrqMMagYj-HOb9EolgOl0mdmye4-1VogbY-0jI,27355
|
32
32
|
computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py,sha256=zZuWz9ArfP3Zss-afnscrPkgCtB5UWbCy7HwAOvO2bo,5970
|
33
33
|
computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQqFP3ZwlthWdqNkn7WETeTHeB6-o98c,11486
|
34
34
|
computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
|
35
35
|
computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
|
36
36
|
computer_use_ootb_internal/preparation/__init__.py,sha256=AgtGHcBpiTkxJjF0xwcs3yyQ6SyUvhL3G0vD2XO-zJw,63
|
37
|
-
computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=
|
38
|
-
computer_use_ootb_internal-0.0.
|
39
|
-
computer_use_ootb_internal-0.0.
|
40
|
-
computer_use_ootb_internal-0.0.
|
41
|
-
computer_use_ootb_internal-0.0.
|
37
|
+
computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=RAriQxrv55csBNBm0m8CKyd_RW8k1tXx0kdJAcOpYlg,4734
|
38
|
+
computer_use_ootb_internal-0.0.167.dist-info/METADATA,sha256=THjx4MBIP8Glxwr7q15ocCo2oVjUbbZo7T9WIzPm6nc,910
|
39
|
+
computer_use_ootb_internal-0.0.167.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
40
|
+
computer_use_ootb_internal-0.0.167.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
|
41
|
+
computer_use_ootb_internal-0.0.167.dist-info/RECORD,,
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# launch_ootb_elevated.ps1
|
2
|
-
param(
|
3
|
-
[Parameter(Mandatory=$true)]
|
4
|
-
[string]$TargetExePath,
|
5
|
-
|
6
|
-
[Parameter(Mandatory=$true)]
|
7
|
-
[string]$Port,
|
8
|
-
|
9
|
-
[Parameter(Mandatory=$true)]
|
10
|
-
[string]$TargetUser,
|
11
|
-
|
12
|
-
[Parameter(Mandatory=$true)]
|
13
|
-
[string]$WorkingDirectory
|
14
|
-
)
|
15
|
-
|
16
|
-
try {
|
17
|
-
Write-Host "--- OOTB Elevation Helper ---"
|
18
|
-
Write-Host "Timestamp: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
|
19
|
-
Write-Host "Received parameters:"
|
20
|
-
Write-Host " Target Exe Path : $TargetExePath"
|
21
|
-
Write-Host " Port : $Port"
|
22
|
-
Write-Host " Target User : $TargetUser"
|
23
|
-
Write-Host " Working Dir : $WorkingDirectory"
|
24
|
-
Write-Host ""
|
25
|
-
|
26
|
-
# Validate paths
|
27
|
-
if (-not (Test-Path -Path $TargetExePath -PathType Leaf)) {
|
28
|
-
throw "Target executable not found at '$TargetExePath'"
|
29
|
-
}
|
30
|
-
if (-not (Test-Path -Path $WorkingDirectory -PathType Container)) {
|
31
|
-
throw "Working directory not found at '$WorkingDirectory'"
|
32
|
-
}
|
33
|
-
|
34
|
-
# Construct the argument list string for the target executable
|
35
|
-
# Ensure target user is single-quoted for the argument parser
|
36
|
-
$argumentList = "--port $Port --target_user '$TargetUser'"
|
37
|
-
|
38
|
-
Write-Host "Constructed ArgumentList for Target Exe: $argumentList"
|
39
|
-
Write-Host "Executing elevated process..."
|
40
|
-
Write-Host "Command: Start-Process -FilePath `$TargetExePath` -ArgumentList `$argumentList` -WorkingDirectory `$WorkingDirectory` -Verb RunAs"
|
41
|
-
Write-Host "--- Waiting for UAC prompt if necessary ---"
|
42
|
-
|
43
|
-
# Execute the command to launch the target exe elevated directly
|
44
|
-
Start-Process -FilePath $TargetExePath -ArgumentList $argumentList -WorkingDirectory $WorkingDirectory -Verb RunAs
|
45
|
-
|
46
|
-
Write-Host "--- OOTB Elevation Helper: Start-Process command executed. ---"
|
47
|
-
# The calling powershell window (started by CreateProcessAsUser with -NoExit) will remain open.
|
48
|
-
|
49
|
-
} catch {
|
50
|
-
Write-Error "--- OOTB Elevation Helper Error ---"
|
51
|
-
Write-Error "Error launching elevated process: $($_.Exception.Message)"
|
52
|
-
Write-Error "Script Parameters:"
|
53
|
-
Write-Error " Target Exe Path : $TargetExePath"
|
54
|
-
Write-Error " Port : $Port"
|
55
|
-
Write-Error " Target User : $TargetUser"
|
56
|
-
Write-Error " Working Dir : $WorkingDirectory"
|
57
|
-
Write-Host "Press Enter to exit..."
|
58
|
-
Read-Host # Keep window open on error
|
59
|
-
Exit 1
|
60
|
-
}
|
61
|
-
|
62
|
-
# Exit gracefully if successful
|
63
|
-
Exit 0
|
{computer_use_ootb_internal-0.0.165.dist-info → computer_use_ootb_internal-0.0.167.dist-info}/WHEEL
RENAMED
File without changes
|