computer-use-ootb-internal 0.0.97.post1__py3-none-any.whl → 0.0.99.post1__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.
@@ -6,6 +6,7 @@ import threading
6
6
  import requests
7
7
  import platform # Add platform import
8
8
  import subprocess # Add subprocess import
9
+ import pyautogui # Add pyautogui import
9
10
  from fastapi import FastAPI, Request
10
11
  from fastapi.responses import JSONResponse
11
12
  from fastapi.middleware.cors import CORSMiddleware
@@ -95,7 +96,9 @@ def prepare_environment(state):
95
96
  if platform.system() == "Windows":
96
97
  # Assuming Star Rail mode is indicated by user_id containing "star_rail"
97
98
  # You might need to adjust this condition based on the actual logic in run_teachmode_args
98
- is_star_rail = "star_rail" in state.user_id.lower()
99
+ is_star_rail = "star_rail" in state.user_id.lower() or \
100
+ "star_rail" in state.trace_id.lower() or \
101
+ "hero_case" in state.trace_id.lower()
99
102
 
100
103
  if is_star_rail:
101
104
  print("Star Rail mode detected on Windows. Opening Edge browser...")
@@ -104,6 +107,15 @@ def prepare_environment(state):
104
107
  # Use cmd /c start to open the URL in Edge without blocking
105
108
  subprocess.run(["cmd", "/c", "start", "msedge", url], check=True, shell=False)
106
109
  print(f"Successfully requested Edge to open {url}")
110
+
111
+ # Add pyautogui click after opening the browser
112
+ time.sleep(2) # Wait a bit for the browser to potentially load
113
+ screen_width, screen_height = pyautogui.size()
114
+ click_x = int(screen_width * (1036 / 1280))
115
+ click_y = int(screen_height * (500 / 720))
116
+ print(f"Clicking at coordinates: ({click_x}, {click_y})")
117
+ pyautogui.click(click_x, click_y)
118
+
107
119
  except FileNotFoundError:
108
120
  print("Error: Microsoft Edge not found. Please ensure it's installed and in PATH.")
109
121
  except Exception as e:
@@ -137,6 +149,9 @@ async def update_parameters(request: Request):
137
149
 
138
150
  log_ootb_request(shared_state.server_url, "update_params", data)
139
151
 
152
+ # Call the preparation function here, after parameters are updated
153
+ prepare_environment(shared_state)
154
+
140
155
  return JSONResponse(
141
156
  content={"status": "success", "message": "Parameters updated", "new_args": vars(shared_state.args)},
142
157
  status_code=200
@@ -311,9 +326,6 @@ def process_input():
311
326
  shared_state.is_paused = False
312
327
  shared_state.stop_event.clear() # Ensure stop event is cleared at the start
313
328
 
314
- # Call the preparation function before starting the loop
315
- prepare_environment(shared_state)
316
-
317
329
  print(f"start sampling loop: {shared_state.chatbot_messages}")
318
330
  print(f"shared_state.args before sampling loop: {shared_state.args}")
319
331
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.97.post1
3
+ Version: 0.0.99.post1
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -1,5 +1,5 @@
1
1
  computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6Grub7li4,31
2
- computer_use_ootb_internal/app_teachmode.py,sha256=5Ek9cY9-wZvgTw67noYHGvE-oWu28biXU--4kfamjAs,17127
2
+ computer_use_ootb_internal/app_teachmode.py,sha256=N2M7lGLwCezvZytdy884Cy1qF7C3pPGaF1FyayPnE3M,17756
3
3
  computer_use_ootb_internal/app_teachmode_gradio.py,sha256=zAw-n3s20j1Jr0S4TzXHwllKV6APJ8HEHB1KqBuzriY,7907
4
4
  computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
5
5
  computer_use_ootb_internal/example_websocket_js.html,sha256=BLYwDExVlgiAX4vXVXW3RuP5KD8FXE4EFXIl54bwF7w,1322
@@ -38,7 +38,7 @@ computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py,sha256=zZu
38
38
  computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQqFP3ZwlthWdqNkn7WETeTHeB6-o98c,11486
39
39
  computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
40
40
  computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
41
- computer_use_ootb_internal-0.0.97.post1.dist-info/METADATA,sha256=RodVMKF5EUHUHdzQg84aLdfxiM-PYC0d0gH8eRGWdjg,942
42
- computer_use_ootb_internal-0.0.97.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
- computer_use_ootb_internal-0.0.97.post1.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
44
- computer_use_ootb_internal-0.0.97.post1.dist-info/RECORD,,
41
+ computer_use_ootb_internal-0.0.99.post1.dist-info/METADATA,sha256=KvfE1u3MumMHrbYvdCGhksJpFuqjbZAxA12qpmgrl3U,942
42
+ computer_use_ootb_internal-0.0.99.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
+ computer_use_ootb_internal-0.0.99.post1.dist-info/entry_points.txt,sha256=-AbmawU7IRQuDZihgVMVDrFoY4E6rnXYOUB-5vSeBKs,93
44
+ computer_use_ootb_internal-0.0.99.post1.dist-info/RECORD,,