Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ export type SandboxCapability = {
supported: boolean;
mechanism: string;
platform: string;
/** 是否支持断网变体(sandboxOffline)。Windows 免管理员方案恒为 false。 */
network_control: boolean;
reason?: string;
};

/** WebUI:沙箱在桌面端执行,浏览器的 OS 不代表执行端平台;null = 未知,显示通用文案。 */
export function inferSandboxPlatform(): "macos" | "linux" | "windows" | null {
return null;
}

/** WebUI:沙箱在桌面端执行,浏览器侧无从探测;null 表示能力未知(由桌面端裁决)。 */
export function useSandboxCapability(): SandboxCapability | null {
return null;
Expand Down
11 changes: 10 additions & 1 deletion crates/agent-gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,13 @@ chardetng = "0.1.17"
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSButton", "NSControl", "NSView", "NSWindow"] }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Threading"] }
windows-sys = { version = "0.61", features = [
"Win32_Foundation",
"Win32_Storage_FileSystem",
"Win32_Security",
"Win32_Security_Authorization",
"Win32_System_Threading",
"Win32_System_JobObjects",
"Win32_System_Console",
"Win32_System_Environment",
] }
5 changes: 5 additions & 0 deletions crates/agent-gui/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,11 @@ fn configure_windows_window_chrome(app: &tauri::App) -> tauri::Result<()> {

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// 最早期钩子:若本进程是 Windows 沙箱的自我再执行启动器(__sandbox_exec),
// 就在此建立受限令牌并运行真实命令,以其退出码退出——绝不继续初始化 Tauri。
// 非 Windows 平台为空操作。
runtime::windows_sandbox::run_sandbox_launcher_if_requested();

let automation_store = Arc::new(
services::automation::AutomationStore::open()
.expect("failed to initialize LiveAgent automation store"),
Expand Down
1 change: 1 addition & 0 deletions crates/agent-gui/src-tauri/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pub mod shell_runner;
pub mod shell_session;
pub mod task_runner;
pub mod terminal;
pub mod windows_sandbox;
Loading
Loading