computer-use-ootb-internal 0.0.133__tar.gz → 0.0.135__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.133 → computer_use_ootb_internal-0.0.135}/PKG-INFO +1 -1
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/pyproject.toml +1 -1
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/guard_service.py +21 -27
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/.gitignore +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/README.md +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/app_teachmode.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/animation/click_animation.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/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.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/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.133 → computer_use_ootb_internal-0.0.135}/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.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/llm_utils.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/oai.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/aws_request.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/base.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/bash.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/collection.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/computer.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/edit.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/run.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/dependency_check.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/preparation/__init__.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/preparation/star_rail_prepare.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/requirements-lite.txt +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/run_teachmode_ootb_args.py +0 -0
- {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/service_manager.py +0 -0
@@ -614,8 +614,7 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
614
614
|
try:
|
615
615
|
session_id = active_sessions[user]
|
616
616
|
token = win32ts.WTSQueryUserToken(session_id)
|
617
|
-
|
618
|
-
env = None # Use default environment provided by CreateProcessAsUser
|
617
|
+
env = win32profile.CreateEnvironmentBlock(token, False) # <-- Restore creating env block
|
619
618
|
startup = win32process.STARTUPINFO()
|
620
619
|
creation_flags = 0x00000010 # CREATE_NEW_CONSOLE
|
621
620
|
|
@@ -625,13 +624,13 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
625
624
|
cwd = os.path.dirname(self.target_executable_path.strip('"')) if os.path.dirname(self.target_executable_path.strip('"')) != '' else None
|
626
625
|
# --- End Launch via cmd /K ---
|
627
626
|
|
628
|
-
self.log_info(f"Calling CreateProcessAsUser to launch via cmd /K (
|
627
|
+
self.log_info(f"Calling CreateProcessAsUser to launch via cmd /K (Restored Environment Block):") # Updated log note
|
629
628
|
self.log_info(f" lpApplicationName: {lpApplicationName}")
|
630
629
|
self.log_info(f" lpCommandLine: {lpCommandLine}")
|
631
630
|
self.log_info(f" lpCurrentDirectory: {cwd if cwd else 'Default'}")
|
632
631
|
self.log_info(f" dwCreationFlags: {creation_flags} (CREATE_NEW_CONSOLE)")
|
633
632
|
|
634
|
-
# CreateProcessAsUser call with env
|
633
|
+
# CreateProcessAsUser call with restored env
|
635
634
|
hProcess, hThread, dwPid, dwTid = win32process.CreateProcessAsUser(
|
636
635
|
token, # User token
|
637
636
|
lpApplicationName, # Application name (None)
|
@@ -640,7 +639,7 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
640
639
|
None, # Thread attributes
|
641
640
|
False, # Inherit handles
|
642
641
|
creation_flags, # Creation flags (CREATE_NEW_CONSOLE)
|
643
|
-
env, # Environment block (
|
642
|
+
env, # Environment block (Restored)
|
644
643
|
cwd, # Current directory for cmd.exe
|
645
644
|
startup # Startup info
|
646
645
|
)
|
@@ -710,47 +709,42 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
710
709
|
return False
|
711
710
|
|
712
711
|
task_name = f"OOTB_UserConnect_{username}" # Renamed task slightly
|
713
|
-
|
714
|
-
|
712
|
+
# Action: Run a simple test command instead of the main executable
|
713
|
+
action_executable = 'cmd.exe'
|
714
|
+
test_output_file = f"C:\Users\{username}\task_test_{task_name}.txt" # User-specific file
|
715
|
+
action_arguments = f"/C echo Task {task_name} ran at %DATE% %TIME% > \"{test_output_file}\"" # Quote the path
|
715
716
|
safe_action_executable = action_executable.replace("'", "''")
|
716
717
|
safe_action_arguments = action_arguments.replace("'", "''")
|
717
718
|
|
718
|
-
# Explicitly set the working directory to the executable's location
|
719
|
+
# Explicitly set the working directory to the executable's location (Might not matter for echo, but keep for consistency)
|
719
720
|
try:
|
720
721
|
executable_dir = os.path.dirname(self.target_executable_path.strip('"'))
|
721
|
-
if not executable_dir:
|
722
|
-
executable_dir = "." # Use current directory as fallback?
|
723
|
-
self.log_warning(f"Could not determine directory for {self.target_executable_path}, task WorkingDirectory might be incorrect.")
|
722
|
+
if not executable_dir: executable_dir = "."
|
724
723
|
safe_working_directory = executable_dir.replace("'", "''")
|
725
724
|
working_directory_setting = f"$action.WorkingDirectory = '{safe_working_directory}'"
|
726
725
|
except Exception as e:
|
727
|
-
self.log_error(f"Error determining working directory for task: {e}.
|
728
|
-
working_directory_setting = "# Could not set WorkingDirectory"
|
726
|
+
self.log_error(f"Error determining working directory for task: {e}. WD will not be set.")
|
727
|
+
working_directory_setting = "# Could not set WorkingDirectory"
|
729
728
|
|
730
729
|
# PowerShell command construction
|
731
730
|
ps_command = f"""
|
732
731
|
$taskName = "{task_name}"
|
733
732
|
$principal = New-ScheduledTaskPrincipal -UserId "{username}" -LogonType Interactive
|
734
733
|
|
735
|
-
# Action: Run
|
734
|
+
# Action: Run the SIMPLE test command
|
736
735
|
$action = New-ScheduledTaskAction -Execute '{safe_action_executable}' -Argument '{safe_action_arguments}'
|
737
|
-
{working_directory_setting}
|
736
|
+
# {working_directory_setting} # Working directory less relevant for this test
|
738
737
|
|
739
|
-
# Trigger: On session connect
|
738
|
+
# Trigger: On session connect (Event ID 21)
|
740
739
|
$logName = 'Microsoft-Windows-TerminalServices-LocalSessionManager/Operational'
|
741
740
|
$source = 'Microsoft-Windows-TerminalServices-LocalSessionManager'
|
742
|
-
$eventIDs = @(21, 25)
|
743
|
-
|
744
|
-
|
745
|
-
#
|
746
|
-
# $trigger = New-ScheduledTaskTrigger -AtLogOn -User "{username}"
|
747
|
-
$trigger = New-ScheduledTaskTrigger -Event -LogName $logName -Source $source -EventId $eventIDs[0] # Primary trigger
|
748
|
-
# Register additional triggers if needed, or handle logic differently.
|
749
|
-
# For simplicity, let's try one event trigger first (ID 21). If reconnect (25) is needed, we can add it.
|
750
|
-
# Consider adding delay: -Delay 'PT15S' # Delay 15 seconds after event?
|
741
|
+
$eventIDs = @(21, 25)
|
742
|
+
$trigger = New-ScheduledTaskTrigger -Event -LogName $logName -Source $source -EventId $eventIDs[0]
|
743
|
+
# Optional Delay: -Delay 'PT15S'
|
744
|
+
# $trigger.Delay = 'PT15S' # Add delay this way if needed
|
751
745
|
|
752
746
|
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit (New-TimeSpan -Days 9999) -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
|
753
|
-
$description = "Runs
|
747
|
+
$description = "**TEST TASK** Runs a simple echo command for user {username} upon session connect." # Updated description
|
754
748
|
|
755
749
|
# Unregister existing task first (force) - Use the NEW task name
|
756
750
|
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue
|
@@ -765,7 +759,7 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
765
759
|
# Append trigger is more complex via PowerShell cmdlets, often easier via XML or COM
|
766
760
|
|
767
761
|
"""
|
768
|
-
self.log_info(f"Attempting to create/update
|
762
|
+
self.log_info(f"Attempting to create/update **TEST TASK** '{task_name}' for user '{username}' to run simple echo command.")
|
769
763
|
try:
|
770
764
|
# Need to actually run the powershell command here!
|
771
765
|
success = self.run_powershell_command(ps_command)
|
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
|