computer-use-ootb-internal 0.0.159__py3-none-any.whl → 0.0.160__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.
@@ -779,22 +779,22 @@ class GuardService(win32serviceutil.ServiceFramework):
779
779
  target_exe_for_ps = target_exe_unquoted.replace("'", "''") # Escape single quotes for PS strings
780
780
  target_exe_dir_for_ps = os.path.dirname(target_exe_unquoted).replace("'", "''")
781
781
 
782
- # 1. 精确构建工作命令的字符串内容 (无外部单引号)
783
- # 模板: Start-Process -FilePath cmd.exe -ArgumentList @('/K', '"<path>" --port <port> --target_user ''<user>''') -WorkingDirectory '<dir>' -Verb RunAs
784
- # 注意内部字符串元素的单引号转义: \' -> \'\', 和用户名的 \'\'<user>\'\'
785
- cmd_k_second_arg_content = f'"""{target_exe_for_ps}""" --port {calculated_port} --target_user ''{user}'''
786
- cmd_k_second_arg_escaped_for_array_literal = cmd_k_second_arg_content.replace("'", "''") # 转义内部字符串元素中的单引号
787
-
788
- working_ps_command = f"Start-Process -FilePath cmd.exe -ArgumentList @('/K', '{cmd_k_second_arg_escaped_for_array_literal}') -WorkingDirectory '{target_exe_dir_for_ps}' -Verb RunAs" # 构建命令主体
789
-
790
- # Escape this content for the outer -Command '...' argument
791
- # Only need to escape literal single quotes (replace ' with '')
792
- # 2. 为外部 powershell.exe -Command '...' 转义整个命令主体中的单引号
793
- working_ps_command_escaped = working_ps_command.replace("'", "''")
794
-
795
- # Final command line using the script block { ... } syntax for -Command
796
- # 3. 生成最终的命令行 (传递给 CreateProcessAsUser 启动的 powershell)
797
- lpCommandLine = f"powershell.exe -NoProfile -ExecutionPolicy Bypass -NoExit -Command '{working_ps_command_escaped}'"
782
+ # 1. 准备 PowerShell 命令中需要的变量 (进行基本的 PowerShell 字符串转义)
783
+ ps_target_exe = target_exe_for_ps
784
+ ps_working_dir = target_exe_dir_for_ps
785
+ # 用户名 'altair' 在最终命令里需要 ''altair'' 格式
786
+ ps_user_arg_format = user.replace("'", "''") # 先转义用户名本身的单引号
787
+
788
+ # 2. 构建最终的、完整的 PowerShell 命令字符串,严格按照模板
789
+ # 模板: Start-Process -FilePath cmd.exe -ArgumentList @('/K', '"<exe_path>" --port <port> --target_user ''<username>''') -WorkingDirectory '<working_dir>' -Verb RunAs
790
+ ps_command_string = f"Start-Process -FilePath cmd.exe -ArgumentList @('/K', '"""{ps_target_exe}""" --port {calculated_port} --target_user ''''{ps_user_arg_format}''''') -WorkingDirectory '{ps_working_dir}' -Verb RunAs"
791
+
792
+ # 3. powershell.exe -Command '...' 参数转义整个命令字符串中的单引号
793
+ ps_command_string_escaped = ps_command_string.replace("'", "''")
794
+
795
+ # 4. 生成最终传递给 CreateProcessAsUser 的命令行
796
+ # 依然使用 powershell.exe -NoExit -Command '{ ... }' 以便观察,虽然不一定有效
797
+ lpCommandLine = f"powershell.exe -NoProfile -ExecutionPolicy Bypass -NoExit -Command '{{ {ps_command_string_escaped} }}'"
798
798
 
799
799
  lpApplicationName = None # Must be None if using lpCommandLine
800
800
  cwd = os.path.dirname(target_exe_unquoted) if os.path.dirname(target_exe_unquoted) else None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.159
3
+ Version: 0.0.160
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -2,7 +2,7 @@ computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6G
2
2
  computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
3
3
  computer_use_ootb_internal/app_teachmode.py,sha256=hiUTiX4jl1-5yqs3AwrOjNmToL5LbUb42o5XS4fiKAA,23805
4
4
  computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
5
- computer_use_ootb_internal/guard_service.py,sha256=QbYhNDM5ytb1ndJD7NeHy1sAxbmzQOjPNKUIXCyU7Gs,53214
5
+ computer_use_ootb_internal/guard_service.py,sha256=3AEUuKM0t_bqhhs34Jj-6bVg5njl_GlOtyLJfqn-19s,53106
6
6
  computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
7
7
  computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=eUPpfA7bB3bdBBiIBIxKJSS-Jpz2G6R46fpDO440Jyo,7687
8
8
  computer_use_ootb_internal/service_manager.py,sha256=SD8jzfn0VVXBOr_nP6zmBWSC2TzrU_sp2e5JJkSlQFU,9734
@@ -34,7 +34,7 @@ computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO
34
34
  computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
35
35
  computer_use_ootb_internal/preparation/__init__.py,sha256=AgtGHcBpiTkxJjF0xwcs3yyQ6SyUvhL3G0vD2XO-zJw,63
36
36
  computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=r0b19M_c1sXkN3_MRFjql8w_ThC9nZUe8zbSLYUvKS8,4635
37
- computer_use_ootb_internal-0.0.159.dist-info/METADATA,sha256=xvY3HIm60gg7bRrpG_tsz0KCw59cmkIj2I-akBDMvTw,1048
38
- computer_use_ootb_internal-0.0.159.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
- computer_use_ootb_internal-0.0.159.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
40
- computer_use_ootb_internal-0.0.159.dist-info/RECORD,,
37
+ computer_use_ootb_internal-0.0.160.dist-info/METADATA,sha256=7KuMFe3UmnWC4ptHq25An_UUVvZXyACS948t8x8AKJs,1048
38
+ computer_use_ootb_internal-0.0.160.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ computer_use_ootb_internal-0.0.160.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
40
+ computer_use_ootb_internal-0.0.160.dist-info/RECORD,,