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.
Files changed (38) hide show
  1. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/PKG-INFO +1 -1
  2. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/pyproject.toml +1 -1
  3. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/guard_service.py +21 -27
  4. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/.gitignore +0 -0
  5. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/README.md +0 -0
  6. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/__init__.py +0 -0
  7. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/app_teachmode.py +0 -0
  8. {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
  9. {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
  10. {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
  11. {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
  12. {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
  13. {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
  14. {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
  15. {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
  16. {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
  17. {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
  18. {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
  19. {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
  20. {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
  21. {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
  22. {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
  23. {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
  24. {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
  25. {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
  26. {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
  27. {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
  28. {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
  29. {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
  30. {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
  31. {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
  32. {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
  33. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/dependency_check.py +0 -0
  34. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/preparation/__init__.py +0 -0
  35. {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
  36. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/src/computer_use_ootb_internal/requirements-lite.txt +0 -0
  37. {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
  38. {computer_use_ootb_internal-0.0.133 → computer_use_ootb_internal-0.0.135}/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.133
3
+ Version: 0.0.135
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "computer-use-ootb-internal"
7
- version = "0.0.133"
7
+ version = "0.0.135"
8
8
  description = "Computer Use OOTB"
9
9
  authors = [{ name = "Siyuan Hu", email = "siyuan.hu.sg@gmail.com" }]
10
10
  requires-python = ">=3.11"
@@ -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
- # env = win32profile.CreateEnvironmentBlock(token, False) # <-- Temporarily disable creating env block
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 (Default Environment Test):") # Added note to log
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 = None
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 (Now None)
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
- action_executable = "cmd.exe"
714
- action_arguments = f'/K "{self.target_executable_path}"'
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: # Handle case where path might be just the exe name
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}. WorkingDirectory will not be set.")
728
- working_directory_setting = "# Could not set WorkingDirectory" # Comment out in PS script
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 cmd.exe with /K, setting the working directory
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/reconnect events for Terminal Services
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) # 21=SessionLogon, 25=SessionReconnect
743
- # The Principal -UserId should ensure this only runs for the target user when they connect
744
- $trigger = New-ScheduledTaskTrigger -AtLogOn # Keep AtLogOn as a fallback?
745
- # --- Let's stick to ONE trigger type first. Replacing AtLogOn with Event ---
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 OOTB Application (via cmd) for user {username} upon session connect (Event Trigger)." # Updated description
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 task '{task_name}' for user '{username}' to run '{action_executable} {action_arguments}' on session connect.")
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)