computer-use-ootb-internal 0.0.125__tar.gz → 0.0.126__tar.gz

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.
Files changed (40) hide show
  1. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/.gitignore +1 -1
  2. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/PKG-INFO +1 -1
  3. computer_use_ootb_internal-0.0.126/deploy.sh +10 -0
  4. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/pyproject.toml +1 -1
  5. computer_use_ootb_internal-0.0.126/src/computer_use_ootb_internal/preparation/star_rail_prepare.py +63 -0
  6. computer_use_ootb_internal-0.0.125/src/computer_use_ootb_internal/preparation/star_rail_prepare.py +0 -65
  7. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/README.md +0 -0
  8. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/__init__.py +0 -0
  9. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/app_teachmode.py +0 -0
  10. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/animation/click_animation.py +0 -0
  11. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif +0 -0
  12. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +0 -0
  13. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py +0 -0
  14. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py +0 -0
  15. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py +0 -0
  16. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py +0 -0
  17. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/__init__.py +0 -0
  18. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_cli.py +0 -0
  19. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_service.py +0 -0
  20. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/llm_utils.py +0 -0
  21. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/oai.py +0 -0
  22. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py +0 -0
  23. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py +0 -0
  24. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/__init__.py +0 -0
  25. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/aws_request.py +0 -0
  26. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/base.py +0 -0
  27. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/bash.py +0 -0
  28. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/collection.py +0 -0
  29. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py +0 -0
  30. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/computer.py +0 -0
  31. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py +0 -0
  32. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/edit.py +0 -0
  33. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/run.py +0 -0
  34. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py +0 -0
  35. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/dependency_check.py +0 -0
  36. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/guard_service.py +0 -0
  37. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/preparation/__init__.py +0 -0
  38. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/requirements-lite.txt +0 -0
  39. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/run_teachmode_ootb_args.py +0 -0
  40. {computer_use_ootb_internal-0.0.125 → computer_use_ootb_internal-0.0.126}/src/computer_use_ootb_internal/service_manager.py +0 -0
@@ -5,4 +5,4 @@
5
5
  screenshot*.png
6
6
  *dist*
7
7
  *.toml
8
- *.sh
8
+ ootb_lite_pypi/ootb_lite_pypi/deploy.sh
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.125
3
+ Version: 0.0.126
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+
3
+ # Clean previous builds
4
+ rm -rf dist
5
+
6
+ # Build the package
7
+ python -m build
8
+
9
+ # Upload to PyPI using API key
10
+ python -m twine upload dist/* -u __token__ -p pypi-AgEIcHlwaS5vcmcCJDkwMTlkNmE2LWFkZmYtNGU2ZC1hYzUwLWFiYmRjYTg4YTNkYgACIlsxLFsiY29tcHV0ZXItdXNlLW9vdGItaW50ZXJuYWwiXV0AAixbMixbIjllNmQ5NTRjLTgxZGEtNGRkNy05Yjk5LWVjYzMzOGUwN2NlZSJdXQAABiBFIKbytGELyFb1-i20Cu4tSo8cAUlX1DCLmUALq0mcPA
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "computer-use-ootb-internal"
7
- version = "0.0.125"
7
+ version = "0.0.126"
8
8
  description = "Computer Use OOTB"
9
9
  authors = [{ name = "Siyuan Hu", email = "siyuan.hu.sg@gmail.com" }]
10
10
  requires-python = ">=3.11"
@@ -0,0 +1,63 @@
1
+ # src/computer_use_ootb_internal/preparation/star_rail_prepare.py
2
+ import time
3
+ import platform
4
+ import subprocess # Added for taskkill
5
+ import webbrowser
6
+ import logging # Use logging instead of print for better practice
7
+
8
+ # Set up logging for this module if needed, or rely on root logger
9
+ log = logging.getLogger(__name__)
10
+
11
+ def run_preparation(state):
12
+ """
13
+ Performs environment preparation specific to Star Rail on Windows.
14
+ Closes existing Edge browsers and opens the specified URL in a new Edge instance.
15
+ """
16
+ if platform.system() != "Windows":
17
+ log.info("Star Rail preparation skipped: Not running on Windows.")
18
+ return
19
+
20
+ log.info("Star Rail preparation: Starting environment setup on Windows...")
21
+ url = "https://sr.mihoyo.com/cloud/#/" # Consider making this configurable later
22
+ browser_opened = False
23
+ try:
24
+ # Attempt to close existing Microsoft Edge processes
25
+ log.info("Attempting to close existing Microsoft Edge processes...")
26
+ try:
27
+ # /F forces termination, /IM specifies image name
28
+ result = subprocess.run(['taskkill', '/F', '/IM', 'msedge.exe'],
29
+ capture_output=True, text=True, check=False)
30
+ if result.returncode == 0:
31
+ log.info("Successfully sent termination signal to msedge.exe processes.")
32
+ elif "not found" in result.stderr.lower() or "not found" in result.stdout.lower():
33
+ log.info("No running msedge.exe processes found to close.")
34
+ else:
35
+ log.warning(f"taskkill command finished with return code {result.returncode}. Output: {result.stdout} Stderr: {result.stderr}")
36
+ time.sleep(2) # Give processes time to close
37
+ except FileNotFoundError:
38
+ log.error("Error: 'taskkill' command not found. Make sure it's in the system PATH.")
39
+ except Exception as e:
40
+ log.error(f"Error occurred while trying to close Edge: {e}", exc_info=True)
41
+
42
+
43
+ # Use only webbrowser.open
44
+ log.info(f"Attempting to open {url} using webbrowser.open()...")
45
+ if webbrowser.open(url):
46
+ log.info(f"Successfully requested browser to open {url} via webbrowser.open().")
47
+ browser_opened = True
48
+ time.sleep(5) # Wait time for the browser to potentially load the page
49
+ else:
50
+ log.warning("webbrowser.open() returned False, indicating potential failure.")
51
+ # No need to error out completely if browser *request* failed,
52
+ # but it's unlikely the rest of the process would work.
53
+
54
+ if not browser_opened:
55
+ log.error("Failed to confirm browser opening via webbrowser.open().")
56
+
57
+ # Removed pyautogui click logic
58
+
59
+ log.info("Star Rail preparation completed (browser opened).")
60
+
61
+ except Exception as e:
62
+ log.error(f"Error during Star Rail preparation: {e}", exc_info=True)
63
+ # No finally block needed anymore as pyautogui failsafe is removed
@@ -1,65 +0,0 @@
1
- # src/computer_use_ootb_internal/preparation/star_rail_prepare.py
2
- import time
3
- import platform
4
- import pyautogui
5
- import webbrowser
6
- import logging # Use logging instead of print for better practice
7
-
8
- # Set up logging for this module if needed, or rely on root logger
9
- log = logging.getLogger(__name__)
10
-
11
- def run_preparation(state):
12
- """
13
- Performs environment preparation specific to Star Rail on Windows.
14
- Opens the specified URL in Edge and performs initial clicks.
15
- """
16
- if platform.system() != "Windows":
17
- log.info("Star Rail preparation skipped: Not running on Windows.")
18
- return
19
-
20
- log.info("Star Rail preparation: Starting environment setup on Windows...")
21
- url = "https://sr.mihoyo.com/cloud/#/" # Consider making this configurable later
22
- browser_opened = False
23
- try:
24
- # Use only webbrowser.open
25
- log.info(f"Attempting to open {url} using webbrowser.open()...")
26
- if webbrowser.open(url):
27
- log.info(f"Successfully requested browser to open {url} via webbrowser.open().")
28
- browser_opened = True
29
- else:
30
- log.warning("webbrowser.open() returned False, indicating potential failure.")
31
-
32
- if not browser_opened:
33
- log.error("Failed to confirm browser opening via webbrowser.open(). Will still attempt clicks.")
34
-
35
- # Add pyautogui click after attempting to open the browser
36
- log.info("Proceeding with pyautogui actions...")
37
- time.sleep(5) # Wait time for the browser to load
38
-
39
- # Get screen size
40
- screen_width, screen_height = pyautogui.size()
41
- log.info(f"Detected screen size: {screen_width}x{screen_height}")
42
-
43
- # Calculate click coordinates based on a reference resolution (e.g., 1280x720)
44
- # TODO: Make these coordinates more robust or configurable
45
- click_x = int(screen_width * (1036 / 1280))
46
- click_y = int(screen_height * (500 / 720))
47
- log.info(f"Calculated click coordinates: ({click_x}, {click_y})")
48
-
49
- # Disable failsafe before clicking
50
- pyautogui.FAILSAFE = False
51
- log.info("PyAutoGUI failsafe temporarily disabled.")
52
-
53
- log.info(f"Clicking at coordinates: ({click_x}, {click_y})")
54
- pyautogui.click(click_x, click_y)
55
- time.sleep(2)
56
- pyautogui.click(click_x, click_y) # Double click?
57
-
58
- log.info("Star Rail preparation clicks completed.")
59
-
60
- except Exception as e:
61
- log.error(f"Error during Star Rail preparation (browser/click): {e}", exc_info=True)
62
- finally:
63
- # Ensure failsafe is re-enabled
64
- pyautogui.FAILSAFE = True
65
- log.info("PyAutoGUI failsafe re-enabled.")