()
| 338 | } |
| 339 | |
| 340 | async fn initialize_terminal_service() { |
| 341 | use bitfun_core::service::runtime::RuntimeManager; |
| 342 | use bitfun_core::service::terminal::{TerminalApi, TerminalConfig}; |
| 343 | |
| 344 | let mut terminal_config = TerminalConfig::default(); |
| 345 | terminal_config.shell_integration.scripts_dir = Some(terminal_scripts_dir()); |
| 346 | |
| 347 | if let Ok(runtime_manager) = RuntimeManager::new() { |
| 348 | let current_path = std::env::var("PATH").ok(); |
| 349 | if let Some(merged_path) = runtime_manager.merged_path_env(current_path.as_deref()) { |
| 350 | terminal_config |
| 351 | .env |
| 352 | .insert("PATH".to_string(), merged_path.clone()); |
| 353 | #[cfg(windows)] |
| 354 | { |
| 355 | terminal_config.env.insert("Path".to_string(), merged_path); |
| 356 | } |
| 357 | } |
| 358 | } else { |
| 359 | tracing::warn!("Failed to initialize runtime manager for terminal PATH"); |
| 360 | } |
| 361 | |
| 362 | let _terminal_api = TerminalApi::new(terminal_config).await; |
| 363 | tracing::info!("Terminal service initialized"); |
| 364 | } |
| 365 | |
| 366 | /// Initialize all core services (config, AI client, agentic system). |
| 367 | /// Returns (agentic_system, original_skip_confirmation). |
no test coverage detected