feat(auto-title): generate_title_cmd Tauri wrapper + register
Bridge LlmEngine::generate_title across the Tauri boundary. Same shape as the existing extract_content_tags_cmd — `is_loaded` short-circuit so the frontend can detect the "no model" case without firing a synchronous inference, then spawn_blocking + PowerAssertion guard for the heavy work. - src-tauri/src/commands/llm.rs: new generate_title_cmd that wraps `state.llm_engine.generate_title(transcript)`. Returns Result<String, String> — the engine's own InvalidJson / Inference / PromptTooLong errors are stringified at the boundary, same pattern as extract_content_tags_cmd at line 408. - src-tauri/src/lib.rs: register the command in invoke_handler!, immediately after extract_content_tags_cmd in the LLM block. Verified: `cargo check -p kon` passes after a `rm -rf target/.../tauri-*` to clear stale OUT_DIR paths from the project's pre-rename location (transcription-app used to live at ~/CORBEL-Projects/kon/). No code behaviour change from that cleanup — Cargo just needed the cache rebuilt. The frontend wiring follows in the next commit.
This commit is contained in:
@@ -419,6 +419,8 @@ pub fn run() {
|
||||
commands::fs::write_text_file_cmd,
|
||||
// LLM content tags (Phase 9)
|
||||
commands::llm::extract_content_tags_cmd,
|
||||
// Auto-title generation (also via per-row + bulk in History)
|
||||
commands::llm::generate_title_cmd,
|
||||
// Paste (auto-insert at cursor)
|
||||
commands::paste::paste_text,
|
||||
commands::paste::paste_text_replacing,
|
||||
|
||||
Reference in New Issue
Block a user