Replace all instances of the legacy product names "Kon" and "Corbie" with "Magnotia" across user-facing copy, code identifiers, package names, bundle ids, file paths, and documentation. Preserves the unrelated "konsole" (KDE terminal) reference and the parent CORBEL company name. - Renames 10 Rust crates (kon-* → magnotia-*) and the tauri binary - Updates package.json, tauri.conf.json (productName + identifier) - Renames CSS classes (kon-rh-* → magnotia-rh-*) and animations - Renames brand and roadmap docs - Regenerates Cargo.lock and package-lock.json Verified: svelte-check passes; pure-rust crates compile under new names.
70 lines
2.0 KiB
Rust
70 lines
2.0 KiB
Rust
use serde::Serialize;
|
|
|
|
use magnotia_core::hardware::{self, Os};
|
|
use magnotia_core::recommendation;
|
|
|
|
#[derive(Serialize)]
|
|
pub struct SystemInfo {
|
|
pub ram_mb: u64,
|
|
pub cpu_brand: String,
|
|
pub cpu_cores: usize,
|
|
pub os: String,
|
|
pub gpu: Option<String>,
|
|
}
|
|
|
|
#[derive(Serialize)]
|
|
pub struct ModelRecommendation {
|
|
pub id: String,
|
|
pub display_name: &'static str,
|
|
pub disk_size_mb: u64,
|
|
pub ram_required_mb: u64,
|
|
pub description: &'static str,
|
|
pub score: f64,
|
|
pub reason: String,
|
|
pub is_downloaded: bool,
|
|
}
|
|
|
|
/// Probe system hardware and return a summary.
|
|
#[tauri::command]
|
|
pub fn probe_system() -> Result<SystemInfo, String> {
|
|
let profile = hardware::probe_system();
|
|
Ok(SystemInfo {
|
|
ram_mb: profile.ram.0,
|
|
cpu_brand: profile.cpu.brand,
|
|
cpu_cores: profile.cpu.logical_processors,
|
|
os: match profile.os {
|
|
Os::Windows => "Windows",
|
|
Os::Linux => "Linux",
|
|
Os::MacOs => "macOS",
|
|
Os::Ios => "iOS",
|
|
Os::Android => "Android",
|
|
}
|
|
.to_string(),
|
|
gpu: profile.gpu.map(|g| format!("{:?}", g.vendor)),
|
|
})
|
|
}
|
|
|
|
/// Rank models for the current system and return recommendations.
|
|
#[tauri::command]
|
|
pub fn rank_models() -> Result<Vec<ModelRecommendation>, String> {
|
|
let profile = hardware::probe_system();
|
|
let ranked = recommendation::rank_recommendations(&profile);
|
|
|
|
Ok(ranked
|
|
.into_iter()
|
|
.map(|scored| {
|
|
let downloaded = magnotia_transcription::is_downloaded(&scored.entry.id);
|
|
ModelRecommendation {
|
|
id: scored.entry.id.as_str().to_string(),
|
|
display_name: scored.entry.display_name,
|
|
disk_size_mb: scored.entry.disk_size.0,
|
|
ram_required_mb: scored.entry.ram_required.0,
|
|
description: scored.entry.description,
|
|
score: scored.score,
|
|
reason: scored.reason,
|
|
is_downloaded: downloaded,
|
|
}
|
|
})
|
|
.collect())
|
|
}
|