refactor: replace welcome message with server_info status payload

Unify the initial connection handshake and capability update paths.
The server now sends a server_info status message on connect and
whenever capabilities change, enabling the onboarding flow where
voice becomes available after models are configured.
This commit is contained in:
Mohamed Boudra
2026-03-12 20:38:03 +07:00
parent 554017b0b8
commit b09a731d85
16 changed files with 177 additions and 162 deletions
@@ -333,8 +333,31 @@ fn bundled_runtime_root(app: &AppHandle) -> Result<PathBuf, String> {
return Ok(candidate);
}
} else {
log::info!("[runtime] resource_dir() unavailable");
log::info!("[runtime] resource_dir() unavailable, resolving from executable path");
}
// Fallback: resolve symlinks and search relative to the real executable location.
// Handles CLI symlink invocation where Tauri can't resolve resource_dir.
if let Ok(canonical) = std::env::current_exe().and_then(|p| p.canonicalize()) {
let exe_dir = dunce::simplified(&canonical);
if let Some(exe_dir) = exe_dir.parent() {
let mut candidates = vec![exe_dir.join("resources"), exe_dir.to_path_buf()];
if let Some(contents_dir) = exe_dir.parent() {
candidates.push(contents_dir.join("Resources"));
candidates.push(contents_dir.join("resources"));
}
for resource_dir in candidates {
if let Some(found) = bundled_runtime_root_from_resource_dir(&resource_dir) {
log::info!(
"[runtime] found bundled runtime (via exe fallback) at {}",
found.display()
);
return Ok(found);
}
}
}
}
log::error!("[runtime] no managed runtime found");
Err("Managed runtime resources are not bundled with this desktop build.".to_string())
}