computer-use-ootb-internal 0.0.130__tar.gz → 0.0.131__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.
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/PKG-INFO +1 -1
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/pyproject.toml +1 -1
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/guard_service.py +54 -19
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/.gitignore +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/README.md +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/app_teachmode.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/animation/click_animation.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_cli.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_service.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/llm_utils.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/oai.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/aws_request.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/base.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/bash.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/collection.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/computer.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/edit.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/run.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/dependency_check.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/preparation/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/preparation/star_rail_prepare.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/requirements-lite.txt +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/run_teachmode_ootb_args.py +0 -0
- {computer_use_ootb_internal-0.0.130 → computer_use_ootb_internal-0.0.131}/src/computer_use_ootb_internal/service_manager.py +0 -0
@@ -711,31 +711,33 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
711
711
|
return "failed_exception"
|
712
712
|
|
713
713
|
def create_or_update_logon_task(self, username):
|
714
|
-
"""Creates or updates a scheduled task to run the OOTB app on user logon."""
|
714
|
+
"""Creates or updates a scheduled task to run the OOTB app via cmd /K on user logon."""
|
715
715
|
if not self.target_executable_path:
|
716
716
|
self.log_error(f"Cannot create task for {username}: Target executable path is not set.")
|
717
717
|
return False
|
718
718
|
|
719
719
|
task_name = f"OOTB_UserLogon_{username}"
|
720
|
-
#
|
721
|
-
|
722
|
-
|
723
|
-
#
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
720
|
+
# Action: Execute cmd.exe
|
721
|
+
action_executable = "cmd.exe"
|
722
|
+
# Arguments for cmd.exe: /K "path\to\your\exe"
|
723
|
+
# self.target_executable_path should already be quoted if needed
|
724
|
+
action_arguments = f'/K "{self.target_executable_path}"'
|
725
|
+
# Escape single quotes for PowerShell command string if the path itself contains them (unlikely but possible)
|
726
|
+
safe_action_executable = action_executable.replace("'", "''")
|
727
|
+
safe_action_arguments = action_arguments.replace("'", "''")
|
728
|
+
|
729
|
+
# PowerShell command construction
|
729
730
|
ps_command = f"""
|
730
731
|
$taskName = "{task_name}"
|
731
732
|
$principal = New-ScheduledTaskPrincipal -UserId "{username}" -LogonType Interactive
|
732
|
-
# Action: Run the target executable
|
733
|
-
$action = New-ScheduledTaskAction -Execute '{
|
734
|
-
# Optional: Set working directory if needed
|
735
|
-
#
|
733
|
+
# Action: Run cmd.exe with /K to launch the target executable and keep window open
|
734
|
+
$action = New-ScheduledTaskAction -Execute '{safe_action_executable}' -Argument '{safe_action_arguments}'
|
735
|
+
# Optional: Set working directory for cmd.exe if needed.
|
736
|
+
# Defaults often work, but could set explicitly to executable's dir:
|
737
|
+
# $action.WorkingDirectory = '{os.path.dirname(self.target_executable_path.strip('"')).replace("'", "''")}'
|
736
738
|
$trigger = New-ScheduledTaskTrigger -AtLogOn -User "{username}"
|
737
739
|
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit (New-TimeSpan -Days 9999) -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
|
738
|
-
$description = "Runs OOTB Application for user {username} upon logon."
|
740
|
+
$description = "Runs OOTB Application (via cmd) for user {username} upon logon."
|
739
741
|
|
740
742
|
# Unregister existing task first (force)
|
741
743
|
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue
|
@@ -743,13 +745,46 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
743
745
|
# Register the new task
|
744
746
|
Register-ScheduledTask -TaskName $taskName -Principal $principal -Action $action -Trigger $trigger -Settings $settings -Description $description -Force
|
745
747
|
"""
|
746
|
-
self.log_info(f"Attempting to create/update task '{task_name}' for user '{username}' to run '{
|
748
|
+
self.log_info(f"Attempting to create/update task '{task_name}' for user '{username}' to run '{action_executable} {action_arguments}'")
|
747
749
|
try:
|
748
|
-
#
|
749
|
-
self.
|
750
|
+
# Need to actually run the powershell command here!
|
751
|
+
success = self.run_powershell_command(ps_command)
|
752
|
+
if success:
|
753
|
+
self.log_info(f"Successfully ran PowerShell command to create/update task '{task_name}'.")
|
754
|
+
return True
|
755
|
+
else:
|
756
|
+
self.log_error(f"PowerShell command failed to create/update task '{task_name}'. See previous logs.")
|
757
|
+
return False
|
758
|
+
except Exception as e:
|
759
|
+
self.log_error(f"Failed to create/update scheduled task '{task_name}' for user '{username}': {e}", exc_info=True)
|
760
|
+
return False
|
761
|
+
|
762
|
+
def run_powershell_command(self, command, log_output=True):
|
763
|
+
"""Executes a PowerShell command and handles output/errors. Returns True on success."""
|
764
|
+
self.log_info(f"Executing PowerShell: {command}")
|
765
|
+
try:
|
766
|
+
result = subprocess.run(
|
767
|
+
["powershell.exe", "-NoProfile", "-NonInteractive", "-Command", command],
|
768
|
+
capture_output=True, text=True, check=True, encoding='utf-8', errors='ignore'
|
769
|
+
)
|
770
|
+
if log_output and result.stdout:
|
771
|
+
self.log_info(f"PowerShell STDOUT:\n{result.stdout.strip()}")
|
772
|
+
if log_output and result.stderr:
|
773
|
+
# Log stderr as info, as some commands write status here (like unregister task not found)
|
774
|
+
self.log_info(f"PowerShell STDERR:\n{result.stderr.strip()}")
|
750
775
|
return True
|
776
|
+
except FileNotFoundError:
|
777
|
+
self.log_error("'powershell.exe' not found. Cannot manage scheduled tasks.")
|
778
|
+
return False
|
779
|
+
except subprocess.CalledProcessError as e:
|
780
|
+
# Log error but still return False, handled by caller
|
781
|
+
self.log_error(f"PowerShell command failed (Exit Code {e.returncode}):")
|
782
|
+
self.log_error(f" Command: {e.cmd}")
|
783
|
+
if e.stdout: self.log_error(f" STDOUT: {e.stdout.strip()}")
|
784
|
+
if e.stderr: self.log_error(f" STDERR: {e.stderr.strip()}")
|
785
|
+
return False
|
751
786
|
except Exception as e:
|
752
|
-
self.log_error(f"
|
787
|
+
self.log_error(f"Unexpected error running PowerShell: {e}", exc_info=True)
|
753
788
|
return False
|
754
789
|
|
755
790
|
def remove_logon_task(self, username):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|