Files
EveFlow/shared/bridge.ts
T
Claude eefc36aca8 feat: local offline voice models (sherpa-onnx) with model manager and wake word (v2.1.0)
- electron/voice: model catalog (Whisper base/small/turbo, SenseVoice, Kokoro v1.0,
  Piper fr), streaming tar.bz2 downloader with progress, sherpa-onnx worker running in
  an Electron utilityProcess (transcribe / synthesize / status / unload), IPC + bridge.
- Renderer: 'local' providers for STT and TTS, Settings → Modèles locaux (download,
  progress, delete, activate), speaker selection, hands-free wake word with a tolerant
  matcher (accents, punctuation, edit distance) and attention window after a bare wake word.
- Packaging: native addon and worker unpacked from the asar; release 2.1.0.

Validated on Linux: Kokoro (fr) → Whisper base round trip, Piper (fr) → Whisper round trip.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
2026-09-03 17:43:52 +00:00

75 lines
2.4 KiB
TypeScript

import type {
AppInfo,
HermesPushEvent,
HotkeyEvent,
HttpProxyRequest,
HttpProxyResponse,
HttpStreamEvent,
HttpStreamStart,
LogEntry,
SystemMetrics,
WebhookStatus,
WindowMode
} from './ipc';
import type {
SynthesizeRequest,
SynthesizeResult,
TranscribeRequest,
TranscribeResult,
VoiceDownloadProgress,
VoiceEngineStatus,
VoiceModelStatus
} from './voice';
export type Unsubscribe = () => void;
/** The API exposed on `window.eveflow` by the preload script. */
export interface EveFlowBridge {
window: {
control: (action: 'minimize' | 'maximize' | 'close' | 'hide') => void;
setMode: (mode: WindowMode) => void;
onModeChanged: (cb: (mode: WindowMode) => void) => Unsubscribe;
};
log: (entry: LogEntry) => void;
store: {
get: <T = unknown>(key: string) => Promise<T | null>;
set: (key: string, value: unknown) => Promise<boolean>;
delete: (key: string) => Promise<boolean>;
};
http: {
fetch: (req: HttpProxyRequest) => Promise<HttpProxyResponse>;
streamStart: (id: string, req: HttpProxyRequest) => Promise<HttpStreamStart>;
streamAbort: (id: string) => void;
onStreamEvent: (cb: (event: HttpStreamEvent) => void) => Unsubscribe;
};
system: {
metrics: () => Promise<SystemMetrics>;
appInfo: () => Promise<AppInfo>;
};
files: {
readLocal: (filePath: string) => Promise<string>;
writeShared: (filename: string, content: string, isBase64?: boolean) => Promise<{ path: string; url: string }>;
openPath: (filePath: string) => Promise<boolean>;
showInFolder: (filePath: string) => Promise<boolean>;
};
hermes: {
onPush: (cb: (event: HermesPushEvent) => void) => Unsubscribe;
webhookStatus: () => Promise<WebhookStatus>;
webhookRestart: () => Promise<WebhookStatus>;
};
hotkeys: {
on: (cb: (event: HotkeyEvent) => void) => Unsubscribe;
};
voice: {
status: () => Promise<VoiceEngineStatus>;
listModels: () => Promise<VoiceModelStatus[]>;
downloadModel: (id: string) => Promise<VoiceModelStatus>;
cancelDownload: (id: string) => Promise<boolean>;
removeModel: (id: string) => Promise<VoiceModelStatus[]>;
onProgress: (cb: (progress: VoiceDownloadProgress) => void) => Unsubscribe;
transcribe: (req: TranscribeRequest) => Promise<TranscribeResult>;
synthesize: (req: SynthesizeRequest) => Promise<SynthesizeResult>;
unload: (id?: string) => Promise<unknown>;
};
}