computer-use-ootb-internal 0.0.121__tar.gz → 0.0.122__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 (41) hide show
  1. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/PKG-INFO +1 -1
  2. computer_use_ootb_internal-0.0.122/deploy.sh +10 -0
  3. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/pyproject.toml +1 -1
  4. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/guard_service.py +56 -20
  5. computer_use_ootb_internal-0.0.121/deploy.sh +0 -3
  6. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/.gitignore +0 -0
  7. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/README.md +0 -0
  8. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/__init__.py +0 -0
  9. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/app_teachmode.py +0 -0
  10. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/app_teachmode_gradio.py +0 -0
  11. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/animation/click_animation.py +0 -0
  12. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif +0 -0
  13. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +0 -0
  14. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py +0 -0
  15. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py +0 -0
  16. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py +0 -0
  17. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py +0 -0
  18. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/__init__.py +0 -0
  19. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_cli.py +0 -0
  20. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_service.py +0 -0
  21. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/llm_utils.py +0 -0
  22. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/oai.py +0 -0
  23. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py +0 -0
  24. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py +0 -0
  25. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/__init__.py +0 -0
  26. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/aws_request.py +0 -0
  27. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/base.py +0 -0
  28. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/bash.py +0 -0
  29. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/collection.py +0 -0
  30. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py +0 -0
  31. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/computer.py +0 -0
  32. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py +0 -0
  33. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/edit.py +0 -0
  34. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/run.py +0 -0
  35. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py +0 -0
  36. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/dependency_check.py +0 -0
  37. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/preparation/__init__.py +0 -0
  38. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/preparation/star_rail_prepare.py +0 -0
  39. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/requirements-lite.txt +0 -0
  40. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/run_teachmode_ootb_args.py +0 -0
  41. {computer_use_ootb_internal-0.0.121 → computer_use_ootb_internal-0.0.122}/src/computer_use_ootb_internal/service_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.121
3
+ Version: 0.0.122
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-AgEIcHlwaS5vcmcCJGNiMDY2MzY0LWU0YWItNGNkZi1iNmJiLWViOTVjYTQ1NDA3NgACKlszLCIyNjgwNjg2Yy1lZDk2LTQxZGYtYjE2MC02ZGRmYWM4YjBlMWQiXQAABiC8l1-r93zvUfQ4W-aqfGCKady5e-94jEFbPA1SFyDgCw
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "computer-use-ootb-internal"
7
- version = "0.0.121"
7
+ version = "0.0.122"
8
8
  description = "Computer Use OOTB"
9
9
  authors = [{ name = "Siyuan Hu", email = "siyuan.hu.sg@gmail.com" }]
10
10
  requires-python = ">=3.11"
@@ -134,20 +134,54 @@ class GuardService(win32serviceutil.ServiceFramework):
134
134
  # --- End Instance Logging ---
135
135
 
136
136
  # --- Instance Helper Methods (Moved from module level) ---
137
+ def get_base_python_executable(self):
138
+ """Tries to find python.exe instead of pythonservice.exe if running as service."""
139
+ service_exe = sys.executable
140
+ self.log_info(f"get_base_python_executable: sys.executable is {service_exe}")
141
+ # Normalize path for comparison
142
+ service_exe_lower = service_exe.lower()
143
+
144
+ # Check if running as pythonservice.exe
145
+ if 'pythonservice.exe' in os.path.basename(service_exe_lower):
146
+ # Construct expected python.exe path in the same directory
147
+ dir_name = os.path.dirname(service_exe)
148
+ potential_python_exe = os.path.join(dir_name, 'python.exe')
149
+ self.log_info(f"get_base_python_executable: Checking for python.exe at {potential_python_exe}")
150
+
151
+ if os.path.exists(potential_python_exe):
152
+ self.log_info(f"get_base_python_executable: Found python.exe at {potential_python_exe}")
153
+ # Quote if necessary
154
+ final_exe = potential_python_exe
155
+ if " " in final_exe and not final_exe.startswith('"'):
156
+ return f'"{final_exe}"'
157
+ return final_exe
158
+ else:
159
+ self.log_error(f"get_base_python_executable: Could not find python.exe near pythonservice.exe (checked {potential_python_exe}). Falling back to using {service_exe}.")
160
+ # Fallback to original sys.executable (quoted if needed)
161
+ if " " in service_exe and not service_exe.startswith('"'):
162
+ return f'"{service_exe}"'
163
+ return service_exe
164
+ else: # Not running as pythonservice.exe, assume sys.executable is correct
165
+ self.log_info(f"get_base_python_executable: sys.executable is not pythonservice.exe, using it directly.")
166
+ if " " in service_exe and not service_exe.startswith('"'):
167
+ return f'"{service_exe}"'
168
+ return service_exe
169
+
137
170
  def get_python_executable(self):
138
- python_exe = sys.executable
139
- if " " in python_exe and not python_exe.startswith('"'):
140
- python_exe = f'"{python_exe}"'
141
- return python_exe
171
+ # This method is now just an alias for clarity if needed elsewhere,
172
+ # but primary logic uses get_base_python_executable directly.
173
+ # Keep for potential compatibility if anything still calls it.
174
+ return self.get_base_python_executable()
142
175
 
143
176
  def get_pip_executable(self):
144
177
  """Tries to locate the pip executable in the same environment."""
145
178
  try:
146
- current_python = sys.executable
147
- self.log_info(f"get_pip_executable: sys.executable = {current_python}")
148
- python_path = pathlib.Path(current_python)
179
+ # Use the potentially corrected python path to find pip's location
180
+ # Note: This assumes pip is relative to python.exe, not pythonservice.exe
181
+ base_python = self.get_base_python_executable()
182
+ python_path = pathlib.Path(base_python.strip('"')) # Use unquoted path
149
183
  pip_path = python_path.parent / "Scripts" / "pip.exe"
150
- self.log_info(f"get_pip_executable: Checking for pip at {pip_path}")
184
+ self.log_info(f"get_pip_executable: Checking for pip relative to {python_path.parent} at {pip_path}")
151
185
 
152
186
  if pip_path.exists():
153
187
  self.log_info(f"get_pip_executable: pip.exe found at {pip_path}")
@@ -156,14 +190,14 @@ class GuardService(win32serviceutil.ServiceFramework):
156
190
  pip_exe = f'"{pip_exe}"'
157
191
  return pip_exe
158
192
  else:
159
- self.log_error(f"get_pip_executable: pip.exe NOT found at {pip_path}. Falling back to 'python -m pip'.")
193
+ self.log_error(f"get_pip_executable: pip.exe NOT found at {pip_path}. Falling back to '{base_python} -m pip'.")
160
194
  pass
161
-
162
195
  except Exception as e:
163
196
  self.log_error(f"get_pip_executable: Error determining pip path: {e}", exc_info=True)
164
- self.log_error("get_pip_executable: Falling back to 'python -m pip' due to error.")
197
+ self.log_error(f"get_pip_executable: Falling back to 'python -m pip' due to error.")
165
198
 
166
- return f"{self.get_python_executable()} -m pip"
199
+ # Fallback uses the potentially corrected python path
200
+ return f"{self.get_base_python_executable()} -m pip"
167
201
 
168
202
  # --- PowerShell Methods (Moved from module level) ---
169
203
  def run_powershell_command(self, command, log_output=True):
@@ -250,11 +284,13 @@ class GuardService(win32serviceutil.ServiceFramework):
250
284
  self.command_processor_thread = None
251
285
  self.session = requests.Session()
252
286
 
253
- # Initialize paths using instance methods
254
- self.python_exe = self.get_python_executable()
287
+ # Initialize paths using instance methods that prefer python.exe
288
+ self.python_exe = self.get_base_python_executable()
255
289
  self.pip_command_base = self.get_pip_executable()
290
+ # Construct command using the potentially corrected python.exe path
256
291
  self.ootb_command = f"{self.python_exe} -m {_OOTB_MODULE}"
257
292
  _service_instance = self
293
+ self.log_info(f"Service initialized. OOTB command set to: {self.ootb_command}")
258
294
 
259
295
  def SvcStop(self):
260
296
  self.log_info(f"Service stop requested.")
@@ -413,10 +449,11 @@ class GuardService(win32serviceutil.ServiceFramework):
413
449
  target_users.add(username.lower())
414
450
  else:
415
451
  target_users.add(target_user.lower())
416
-
417
452
  self.log_info(f"Searching for OOTB processes for users: {target_users}")
418
-
419
- python_exe_path = self.python_exe.strip('"') # Get unquoted path for comparison
453
+
454
+ # Use the potentially corrected python.exe path for matching
455
+ python_exe_path_for_check = self.python_exe.strip('"')
456
+ self.log_info(f"_get_ootb_processes: Checking against python path: {python_exe_path_for_check}")
420
457
 
421
458
  for proc in psutil.process_iter(['pid', 'name', 'username', 'cmdline', 'exe']):
422
459
  try:
@@ -427,12 +464,11 @@ class GuardService(win32serviceutil.ServiceFramework):
427
464
 
428
465
  if proc_username in target_users:
429
466
  cmdline = ' '.join(pinfo['cmdline']) if pinfo['cmdline'] else ''
430
- # Check if the process executable matches our python path AND module is in cmdline
431
- if pinfo['exe'] and pinfo['exe'] == python_exe_path and _OOTB_MODULE in cmdline:
467
+ # Check if the process executable matches our corrected python path AND module is in cmdline
468
+ if pinfo['exe'] and pinfo['exe'] == python_exe_path_for_check and _OOTB_MODULE in cmdline:
432
469
  self.log_info(f"Found matching OOTB process: PID={pinfo['pid']}, User={pinfo['username']}, Cmd={cmdline}")
433
470
  ootb_procs.append(proc)
434
471
  target_pid_list.append(pinfo['pid'])
435
-
436
472
  except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
437
473
  continue
438
474
  self.log_info(f"Found {len(ootb_procs)} OOTB process(es) matching criteria: {target_pid_list}")
@@ -1,3 +0,0 @@
1
- rm -rf dist
2
- python -m build
3
- python -m twine upload dist/*