From 47832f48989661eeb819ccc8c5a30ae3afcaefc5 Mon Sep 17 00:00:00 2001 From: SWangHash <88996709+SWangHash@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:18:58 +0800 Subject: [PATCH] refactor(core): make tauri optional to drop it from cli dep graph --- src/crates/assembly/core/Cargo.toml | 6 +++--- .../assembly/core/src/agentic/coordination/scheduler.rs | 2 +- src/crates/assembly/core/src/service/cron/service.rs | 2 +- src/crates/services/services-integrations/Cargo.toml | 3 ++- .../services-integrations/src/file_watch/service.rs | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/crates/assembly/core/Cargo.toml b/src/crates/assembly/core/Cargo.toml index d1c9a8f230..2ee5122eca 100644 --- a/src/crates/assembly/core/Cargo.toml +++ b/src/crates/assembly/core/Cargo.toml @@ -147,8 +147,8 @@ bitfun-runtime-services = { path = "../../execution/runtime-services" } # Transport layer dependency bitfun-transport = { path = "../../adapters/transport" } -# Tauri dependency (optional, enabled only when needed) -tauri = { workspace = true } +# Tauri dependency (optional, enabled only when the tauri-support feature is on) +tauri = { workspace = true, optional = true } # Non-Windows: vendored OpenSSL for libgit2 (no system install). [target.'cfg(not(windows))'.dependencies] @@ -225,7 +225,7 @@ service-integrations = [ "bitfun-services-integrations/product-full", ] tool-packs = ["dep:bitfun-tool-packs", "bitfun-tool-packs/product-full", "dep:image"] -tauri-support = [] +tauri-support = ["dep:tauri"] ssh-remote = [ "bitfun-services-integrations/remote-ssh-concrete", "russh", diff --git a/src/crates/assembly/core/src/agentic/coordination/scheduler.rs b/src/crates/assembly/core/src/agentic/coordination/scheduler.rs index 9cf9ac1076..150ea84021 100644 --- a/src/crates/assembly/core/src/agentic/coordination/scheduler.rs +++ b/src/crates/assembly/core/src/agentic/coordination/scheduler.rs @@ -123,7 +123,7 @@ impl DialogScheduler { }); let scheduler_for_handler = Arc::clone(&scheduler); - tauri::async_runtime::spawn(async move { + tokio::spawn(async move { scheduler_for_handler.run_outcome_handler(outcome_rx).await; }); diff --git a/src/crates/assembly/core/src/service/cron/service.rs b/src/crates/assembly/core/src/service/cron/service.rs index 4e8325d499..49aaf37770 100644 --- a/src/crates/assembly/core/src/service/cron/service.rs +++ b/src/crates/assembly/core/src/service/cron/service.rs @@ -99,7 +99,7 @@ impl CronService { } let service = Arc::clone(self); - tauri::async_runtime::spawn(async move { + tokio::spawn(async move { service.run_loop().await; }); } diff --git a/src/crates/services/services-integrations/Cargo.toml b/src/crates/services/services-integrations/Cargo.toml index a47c7a7246..75da8aadb1 100644 --- a/src/crates/services/services-integrations/Cargo.toml +++ b/src/crates/services/services-integrations/Cargo.toml @@ -59,7 +59,7 @@ shellexpand = { workspace = true, optional = true } ssh_config = { workspace = true, optional = true } terminal-core = { path = "../terminal", optional = true } x25519-dalek = { workspace = true, optional = true } -tauri = { workspace = true } +tauri = { workspace = true, optional = true } [target.'cfg(not(windows))'.dependencies] git2 = { workspace = true, features = ["vendored-openssl"], optional = true } @@ -69,6 +69,7 @@ schannel = { version = "0.1", optional = true } [features] default = [] +tauri-support = ["dep:tauri"] announcement = ["reqwest"] browser-control = ["anyhow", "bitfun-services-core", "dirs", "reqwest", "thiserror"] canvas-runtime = [ diff --git a/src/crates/services/services-integrations/src/file_watch/service.rs b/src/crates/services/services-integrations/src/file_watch/service.rs index 8544a2e063..19693b629b 100644 --- a/src/crates/services/services-integrations/src/file_watch/service.rs +++ b/src/crates/services/services-integrations/src/file_watch/service.rs @@ -389,7 +389,7 @@ pub async fn get_watched_paths() -> Result, String> { pub fn initialize_file_watch_service(emitter: Arc) { let watcher = get_global_file_watch_service(); - tauri::async_runtime::spawn(async move { + tokio::spawn(async move { watcher.set_emitter(emitter).await; }); }