mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-05 17:09:40 +00:00
Merge branch 'main' into custom-tokenizer
This commit is contained in:
commit
e3cb7e9734
165 files changed
+4739
-1738
No files matched your search
Generated
+5
-5
@@ -2770,7 +2770,7 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
||||
|
||||
[[package]]
|
||||
name = "mindwork-ai-studio"
|
||||
version = "26.2.2"
|
||||
version = "26.4.1"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"arboard",
|
||||
@@ -2791,7 +2791,7 @@ dependencies = [
|
||||
"pbkdf2",
|
||||
"pdfium-render",
|
||||
"pptx-to-md",
|
||||
"rand 0.10.0",
|
||||
"rand 0.10.1",
|
||||
"rand_chacha 0.10.0",
|
||||
"rcgen",
|
||||
"reqwest 0.13.2",
|
||||
@@ -3833,9 +3833,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8"
|
||||
checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207"
|
||||
dependencies = [
|
||||
"chacha20",
|
||||
"getrandom 0.4.2",
|
||||
@@ -5332,7 +5332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.3.1",
|
||||
"getrandom 0.4.2",
|
||||
"once_cell",
|
||||
"rustix 1.1.4",
|
||||
"windows-sys 0.61.2",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mindwork-ai-studio"
|
||||
version = "26.2.2"
|
||||
version = "26.4.1"
|
||||
edition = "2021"
|
||||
description = "MindWork AI Studio"
|
||||
authors = ["Thorsten Sommer"]
|
||||
@@ -23,7 +23,7 @@ flexi_logger = "0.31.8"
|
||||
log = { version = "0.4.29", features = ["kv"] }
|
||||
once_cell = "1.21.4"
|
||||
rocket = { version = "0.5.1", features = ["json", "tls"] }
|
||||
rand = "0.10.0"
|
||||
rand = "0.10.1"
|
||||
rand_chacha = "0.10.0"
|
||||
base64 = "0.22.1"
|
||||
aes = "0.8.4"
|
||||
|
||||
@@ -135,7 +135,7 @@ pub fn start_tauri() {
|
||||
if !matches!(event, RunEvent::MainEventsCleared) {
|
||||
debug!(Source = "Tauri"; "Tauri event received: location=app event handler , event={event:?}");
|
||||
}
|
||||
|
||||
|
||||
match event {
|
||||
RunEvent::WindowEvent { event, label, .. } => {
|
||||
match event {
|
||||
@@ -494,6 +494,13 @@ pub struct ShortcutResponse {
|
||||
error_message: String,
|
||||
}
|
||||
|
||||
/// Response for application exit requests.
|
||||
#[derive(Serialize)]
|
||||
pub struct AppExitResponse {
|
||||
success: bool,
|
||||
error_message: String,
|
||||
}
|
||||
|
||||
/// Internal helper function to register a shortcut with its callback.
|
||||
/// This is used by both `register_shortcut` and `resume_shortcuts` to
|
||||
/// avoid code duplication.
|
||||
@@ -522,6 +529,34 @@ fn register_shortcut_with_callback(
|
||||
}
|
||||
}
|
||||
|
||||
/// Requests a controlled shutdown of the entire desktop application.
|
||||
#[post("/app/exit")]
|
||||
pub fn exit_app(_token: APIToken) -> Json<AppExitResponse> {
|
||||
let main_window_lock = MAIN_WINDOW.lock().unwrap();
|
||||
let main_window = match main_window_lock.as_ref() {
|
||||
Some(window) => window,
|
||||
None => {
|
||||
error!(Source = "Tauri"; "Cannot exit app: main window not available.");
|
||||
return Json(AppExitResponse {
|
||||
success: false,
|
||||
error_message: "Main window not available".to_string(),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
let app_handle = main_window.app_handle();
|
||||
info!(Source = "Tauri"; "Controlled app exit was requested by the UI.");
|
||||
tauri::async_runtime::spawn(async move {
|
||||
time::sleep(Duration::from_millis(50)).await;
|
||||
app_handle.exit(0);
|
||||
});
|
||||
|
||||
Json(AppExitResponse {
|
||||
success: true,
|
||||
error_message: String::new(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Registers or updates a global shortcut. If the shortcut string is empty,
|
||||
/// the existing shortcut for that name will be unregistered.
|
||||
#[post("/shortcuts/register", data = "<payload>")]
|
||||
@@ -536,7 +571,7 @@ pub fn register_shortcut(_token: APIToken, payload: Json<RegisterShortcutRequest
|
||||
error_message: "Cannot register NONE shortcut".to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
info!(Source = "Tauri"; "Registering global shortcut '{}' with key '{new_shortcut}'.", id);
|
||||
|
||||
// Get the main window to access the global shortcut manager:
|
||||
|
||||
@@ -76,6 +76,7 @@ pub fn start_runtime_api() {
|
||||
crate::file_actions::select_file,
|
||||
crate::file_actions::select_files,
|
||||
crate::file_actions::save_file,
|
||||
crate::app_window::exit_app,
|
||||
crate::secret::get_secret,
|
||||
crate::secret::store_secret,
|
||||
crate::secret::delete_secret,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "MindWork AI Studio",
|
||||
"version": "26.2.2"
|
||||
"version": "26.4.1"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
Reference in new issue
Block a user