feat(kon): wire Tauri shell — thin commands, ProviderRegistry, tray

- lib.rs rewritten from scaffold to full app setup (~70 lines)
- AppState holds Arc<LocalEngine> for Whisper and Parakeet
- commands/models.rs: download, check, list, load for both engines
  Maps legacy size strings (Tiny/Base/Small/Medium) to ModelId
- commands/transcription.rs: transcribe_pcm, transcribe_file, transcribe_pcm_parakeet
  Delegates to LocalEngine.transcribe_sync() + post_process_segments()
- commands/audio.rs: save_audio via kon_audio::write_wav
- commands/windows.rs: open_task_window, open_viewer_window
- commands/llm.rs: 8 stub commands preserved for frontend compatibility
- tray.rs: extracted system tray setup (show, status, quit, click-to-show)
- Close-to-tray behaviour preserved
- All 25 v0.2 command names preserved for Svelte frontend compatibility
- clippy clean

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jake
2026-03-16 21:15:16 +00:00
parent 0646c75de7
commit 29ff91d3f6
9 changed files with 638 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
// LLM stubs — ONNX-based local LLM coming post-revenue.
#[tauri::command]
pub fn check_llm_engine() -> Result<bool, String> {
Ok(false)
}
#[tauri::command]
pub fn check_llm_model(_size: String) -> Result<bool, String> {
Ok(false)
}
#[tauri::command]
pub fn list_llm_models() -> Result<Vec<String>, String> {
Ok(vec![])
}
#[tauri::command]
pub async fn download_llm_model(
_app: tauri::AppHandle,
_size: String,
) -> Result<String, String> {
Err("LLM not available yet — coming soon".into())
}
#[tauri::command]
pub async fn load_llm_model(
_size: String,
) -> Result<String, String> {
Err("LLM not available yet — coming soon".into())
}
#[tauri::command]
pub async fn llm_generate(
_prompt: String,
_max_tokens: Option<u32>,
) -> Result<String, String> {
Err("LLM not available yet — coming soon".into())
}
#[tauri::command]
pub async fn llm_extract_tasks(
_transcript: String,
) -> Result<Vec<String>, String> {
Err("LLM not available yet — coming soon".into())
}
#[tauri::command]
pub async fn llm_format_transcript(
_transcript: String,
) -> Result<String, String> {
Err("LLM not available yet — coming soon".into())
}