feat(driver): clear download cache

This commit is contained in:
zipg authored and GitHub committed 2026-07-08 20:21:05 +08:00
1 parent ac4b98c97c
commit 33b4fc1dac
18 files changed
+168 -28

No files matched your search

+9 -3
View File
@@ -4,9 +4,10 @@ use tauri::{Emitter, State};
use dbx_core::agent_manager::{AgentDriverInfo, DriverStoreUsage, JavaRuntimeConfig, JavaRuntimeMode, DEFAULT_JRE_KEY};
use dbx_core::agent_service::{
build_agent_list, fetch_registry, import_agent_jar, import_agents_from_zip as import_agents_from_zip_core,
install_agent_driver, invalidate_registry_cache, reinstall_agent_jre, uninstall_agent_driver, uninstall_agent_jre,
upgrade_all_agent_drivers, AgentProgressEvent, UpgradeAllAgentDriversResult,
build_agent_list, clear_agent_download_cache, fetch_registry, import_agent_jar,
import_agents_from_zip as import_agents_from_zip_core, install_agent_driver, invalidate_registry_cache,
reinstall_agent_jre, uninstall_agent_driver, uninstall_agent_jre, upgrade_all_agent_drivers, AgentProgressEvent,
UpgradeAllAgentDriversResult,
};
use dbx_core::connection::AppState;
use dbx_core::driver_runtime::DriverRuntimeSummary;
@@ -33,6 +34,11 @@ pub async fn get_driver_store_usage(state: State<'_, Arc<AppState>>) -> Result<D
Ok(state.agent_manager.collect_driver_store_usage(state.plugins.root_dir()))
}
#[tauri::command]
pub async fn clear_driver_download_cache(state: State<'_, Arc<AppState>>) -> Result<(), String> {
clear_agent_download_cache(&state.agent_manager)
}
#[tauri::command]
pub async fn get_driver_runtime_summary(state: State<'_, Arc<AppState>>) -> Result<DriverRuntimeSummary, String> {
Ok(dbx_core::driver_runtime::collect_driver_runtime_summary(state.inner().as_ref()).await)