From e461d4eb223f2f0a4e67335649e556e071b42f39 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Wed, 15 Jul 2026 09:50:12 -0500 Subject: [PATCH] feat(ui): enhanceNotes/monitorAudioLevel/stressTestHardware bindings + events + types --- src/lib/api.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/lib/api.ts b/src/lib/api.ts index b4bf86e..6a749d9 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -56,6 +56,19 @@ export interface AudioDeviceInfo { name: string; } +// Quick hardware stress test (Settings ▸ Hardware): per-(backend, model) +// real-time factor, plus the recommended real-time-capable pairing. +export interface StressResult { + backend: string; + model: string; + rtf: number; + realtime: boolean; +} +export interface StressTestResult { + results: StressResult[]; + recommended: { backend: string; model: string } | null; +} + export interface LlmStatus { provider: string; // ollama|custom|anthropic|off (ADR-0011; "openai" not yet wired) reachable: boolean; @@ -421,6 +434,10 @@ export const api = { setPreferredBackend: (backend: BackendId | "auto") => invoke("set_preferred_backend", { args: { backend } }), setAutoStart: (enabled: boolean) => invoke("set_auto_start", { enabled }), + // Test a device: stream device://level for a few seconds. Resolves when done. + monitorAudioLevel: (kind: "input" | "loopback", deviceId: string | null, durationMs = 6000) => + invoke("monitor_audio_level", { kind, deviceId, durationMs }), + stressTestHardware: () => invoke("stress_test_hardware"), downloadNpuPackage: () => invoke("download_npu_package"), downloadDirectmlPackage: () => invoke("download_directml_package"), listModels: () => invoke("list_models"), @@ -464,6 +481,10 @@ export const api = { deleteMeeting: (meetingId: MeetingId) => invoke("delete_meeting", { meetingId }), updateNotes: (meetingId: MeetingId, markdown: string) => invoke("update_notes", { meetingId, markdown }), + // AI-enhance rough notes into structured Markdown grounded in the transcript + // (Granola-style). Returns the enhanced text; the caller decides to keep it. + enhanceNotes: (meetingId: MeetingId, notes: string) => + invoke("enhance_notes", { meetingId, notes }), // dest is a file path for md/pdf/docx/obsidian, a folder for bundle. // "obsidian" writes one self-contained vault note (no audio) — FR-STORE-4. exportMeeting: ( @@ -613,6 +634,15 @@ export const events = { onHardwareChanged: ( cb: (p: { active: BackendId; reason: string }) => void, ): Promise => listen("hardware://changed", (e) => cb(e.payload as never)), + // Live level meter for a device test (Settings ▸ Hardware). `done` marks the + // end of the monitor window. + onDeviceLevel: ( + cb: (p: { kind: string; rms?: number; peak?: number; done?: boolean }) => void, + ): Promise => listen("device://level", (e) => cb(e.payload as never)), + // Per-(backend, model) progress ticks during the quick stress test. + onStressProgress: ( + cb: (p: { backend: string; model: string }) => void, + ): Promise => listen("stress://progress", (e) => cb(e.payload as never)), onNpuDownload: ( cb: (p: { stage: "model" | "runtime" | "done";