feat #14740: transcription pipeline

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-05 16:41:53 +01:00
co-authored by Claude Opus 5.5
parent 1420e56e77
commit e2828791da
13 changed files with 1066 additions and 17 deletions
+24 -7
View File
@@ -16,6 +16,7 @@ use serde::Serialize;
use tauri::{AppHandle, Emitter, Manager, State};
use tauri_plugin_autostart::ManagerExt;
use crate::processing;
use crate::state::{AppState, CallBrief, DeviceLevels, Ended, PendingPrompt, RecordingState};
const LEVELS_INTERVAL: Duration = Duration::from_millis(100);
@@ -120,19 +121,35 @@ pub fn get_call_brief(state: State<'_, AppState>, id: CallId) -> CmdResult<CallB
#[tauri::command]
pub async fn discard_call(app: AppHandle, id: CallId) -> CmdResult<()> {
blocking(app, move |app| {
if app.state::<AppState>().discard_call(id)? == 0 {
set_window_visible(app, "prompt", false);
}
app.state::<AppState>().discard_call(id)?;
prompt_queue_changed(app);
Ok(())
})
.await
}
/// Placeholder until transcription exists; the prompt shows the error.
/// Transkribieren in the end-of-call prompt: starts processing in the
/// background and returns at once; the call leaves the prompt.
#[tauri::command]
pub fn transcribe_call(id: CallId) -> CmdResult<()> {
let _ = id;
Err("Transkription ist noch nicht verfügbar".to_string())
pub async fn transcribe_call(app: AppHandle, id: CallId) -> CmdResult<()> {
blocking(app, move |app| processing::start(app, id, false)).await
}
/// Processes a failed (or still undecided) call again.
#[tauri::command]
pub async fn retry_call(app: AppHandle, id: CallId) -> CmdResult<()> {
blocking(app, move |app| processing::start(app, id, true)).await
}
/// After a call left the prompt queue: hides the prompt if no call waits
/// any more, and tells it to reload (`prompt-changed`) otherwise.
pub fn prompt_queue_changed(app: &AppHandle) {
if app.state::<AppState>().prompts_waiting() == 0 {
set_window_visible(app, "prompt", false);
}
if let Err(e) = app.emit("prompt-changed", ()) {
log::error!("could not emit prompt-changed: {e}");
}
}
/// Starts a manual recording, shows the floating window and streams levels.