mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-19 05:09:30 +02:00
fix: full review pass (main process, voice pipeline, Hermes client, HUD) and e2e-validated local voice (v2.1.0.1)
Electron main - utility-process channel: sherpa output copied into V8 buffers (Electron rejects external buffers), audio exchanged as base64; worker restart on timeout, identity-safe exit handling, deterministic native unload by restart - webhook: loopback by default without secret, UTF-8-safe body assembly, clean restart, port validation - files IPC: realpath-based root check, openPath allow-list (reveal-only outside document folders), Windows reserved names; store: debounced async atomic writes with backup of corrupt files; logger: streaming writes with rotation; log message size cap - HTTP stream proxy: socket released on idle timeout / renderer destroyed, id validation - model manager: inactivity timeout, retrying rm/rename (Windows locks), engine stopped before replacing a model; WAV decoder handles float/24-bit; IPC payload validation - window: opaque rounded window on Windows, navigation lock-down, visibility events; Ctrl+Alt+Escape instead of the Task Manager shortcut; single-instance guard; EVEFLOW_USER_DATA Voice pipeline - abort semantics (SendHandle.aborted), abort before the stream opens, session id prefixes per transport - hands-free re-arm after replies without speech, start/stop race, no chime on auto re-arm, no silence shipped to STT (400 ms pre-roll), no transcription of empty manual stops - TTS: bounded prefetch, cancellable segments, non-interrupting notices, volume applied at play time - SSE CRLF split, usage in chat completions, finish_reason length, phonetic regex hoisted HUD - core renderer: no canvas shadows, cached colours, reusable spectrum buffer, theme read on change, 30 fps idle, stops when the window is hidden; ping flashes on send / tool / speech - deltas coalesced per animation frame; stable auto-scroll; narrow selectors everywhere - bundled fonts (offline), reduce-motion fix, error toasts, ops drawer below 1180 px, interim transcript and first-token latency in the core caption, Ctrl+K, dialog semantics, switch/aria roles, compact widget cleanup, Whisper small recommended for French - docs/ROADMAP.md: audit results, e2e results and the plan towards a real JARVIS Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
This commit is contained in:
55 files changed
+1181
-433
No files matched your search
@@ -2,6 +2,7 @@ import { useEffect } from 'react';
|
||||
import { Download, Trash2, X, CheckCircle2, Cpu, Mic, Volume2, AlertTriangle, RefreshCw } from 'lucide-react';
|
||||
import type { VoiceModelStatus } from '../../../shared/voice';
|
||||
import { bridge } from '../../lib/bridge';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useVoiceModels } from '../../state/voiceModels';
|
||||
import { useSettings } from '../../state/settings';
|
||||
|
||||
@@ -11,10 +12,11 @@ function formatMb(bytes: number): string {
|
||||
|
||||
function ModelRow({ model }: { model: VoiceModelStatus }) {
|
||||
const progress = useVoiceModels((s) => s.progress[model.id]);
|
||||
const { download, cancel, remove } = useVoiceModels();
|
||||
const settings = useSettings((s) => s.settings);
|
||||
const { download, cancel, remove } = useVoiceModels.getState();
|
||||
const activeStt = useSettings((s) => s.settings.voice.localModel);
|
||||
const activeTts = useSettings((s) => s.settings.speech.localModel);
|
||||
const update = useSettings((s) => s.update);
|
||||
const isActive = model.kind === 'stt' ? settings.voice.localModel === model.id : settings.speech.localModel === model.id;
|
||||
const isActive = model.kind === 'stt' ? activeStt === model.id : activeTts === model.id;
|
||||
const busy = !!progress && (progress.phase === 'download' || progress.phase === 'extract');
|
||||
|
||||
const activate = () => {
|
||||
@@ -59,7 +61,8 @@ function ModelRow({ model }: { model: VoiceModelStatus }) {
|
||||
}
|
||||
|
||||
export function ModelsSection() {
|
||||
const { models, engine, error, refresh, checkEngine } = useVoiceModels();
|
||||
const { models, engine, error } = useVoiceModels(useShallow((s) => ({ models: s.models, engine: s.engine, error: s.error })));
|
||||
const { refresh, checkEngine } = useVoiceModels.getState();
|
||||
useEffect(() => {
|
||||
void refresh();
|
||||
void checkEngine();
|
||||
|
||||
@@ -21,23 +21,35 @@ interface Props {
|
||||
|
||||
function Toggle({ on, onChange, label, hint }: { on: boolean; onChange: (v: boolean) => void; label: string; hint?: string }) {
|
||||
return (
|
||||
<div className="switch" onClick={() => onChange(!on)}>
|
||||
<button type="button" role="switch" aria-checked={on} className="switch" onClick={() => onChange(!on)}>
|
||||
<div className="text">
|
||||
<span>{label}</span>
|
||||
{hint && <small>{hint}</small>}
|
||||
</div>
|
||||
<span className={`toggle${on ? ' on' : ''}`} />
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
type TestState = { status: 'idle' | 'running' | 'ok' | 'fail'; message: string };
|
||||
|
||||
function TestResult({ t }: { t: TestState }) {
|
||||
if (t.status === 'idle') return null;
|
||||
return (
|
||||
<div className={`test-result ${t.status === 'ok' ? 'ok' : t.status === 'fail' ? 'fail' : ''}`}>
|
||||
{t.status === 'running' ? <Loader2 size={13} className="spin" /> : t.status === 'ok' ? <CheckCircle2 size={13} /> : <XCircle size={13} />}
|
||||
<span>{t.message}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function SettingsDrawer({ onClose }: Props) {
|
||||
const settings = useSettings((s) => s.settings);
|
||||
const update = useSettings((s) => s.update);
|
||||
const reset = useSettings((s) => s.reset);
|
||||
const hermesStore = useHermes();
|
||||
const hermesModels = useHermes((s) => s.models);
|
||||
const hermesWebhook = useHermes((s) => s.webhook);
|
||||
const hermesConnect = useHermes((s) => s.connect);
|
||||
const micDevices = useVoice((s) => s.micDevices);
|
||||
const voiceModels = useVoiceModels((s) => s.models);
|
||||
const refreshModels = useVoiceModels((s) => s.refresh);
|
||||
@@ -74,7 +86,7 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
}
|
||||
const via = bridge() ? 'via Electron' : 'via navigateur';
|
||||
setHermesTest({ status: 'ok', message: `${health.status} (${via})${caps}` });
|
||||
void hermesStore.connect();
|
||||
void hermesConnect();
|
||||
} catch (err) {
|
||||
setHermesTest({ status: 'fail', message: (err as Error).message });
|
||||
}
|
||||
@@ -106,14 +118,6 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
useHermes.setState({ webhook: status });
|
||||
};
|
||||
|
||||
const Result = ({ t }: { t: TestState }) =>
|
||||
t.status === 'idle' ? null : (
|
||||
<div className={`test-result ${t.status === 'ok' ? 'ok' : t.status === 'fail' ? 'fail' : ''}`}>
|
||||
{t.status === 'running' ? <Loader2 size={13} className="spin" /> : t.status === 'ok' ? <CheckCircle2 size={13} /> : <XCircle size={13} />}
|
||||
<span>{t.message}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
const nav: Array<[Section, string]> = [
|
||||
['hermes', 'Hermes'],
|
||||
['voice', 'Micro / STT'],
|
||||
@@ -155,7 +159,7 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
<label>Modèle</label>
|
||||
<input className="input" list="hermes-models" value={settings.hermes.model} placeholder="(défaut du serveur)" onChange={(e) => update({ hermes: { model: e.target.value } })} />
|
||||
<datalist id="hermes-models">
|
||||
{hermesStore.models.map((m) => <option key={m.id} value={m.id} />)}
|
||||
{hermesModels.map((m) => <option key={m.id} value={m.id} />)}
|
||||
</datalist>
|
||||
</div>
|
||||
<div className="field">
|
||||
@@ -191,7 +195,7 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
<div className="row" style={{ marginTop: 10 }}>
|
||||
<button className="btn primary small" onClick={() => void testHermes()}><Play size={13} /> Tester la liaison</button>
|
||||
</div>
|
||||
<div style={{ marginTop: 8 }}><Result t={hermesTest} /></div>
|
||||
<div style={{ marginTop: 8 }}><TestResult t={hermesTest} /></div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -284,7 +288,7 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
<div className="row" style={{ marginTop: 10 }}>
|
||||
<button className="btn small" onClick={() => void testStt()} disabled={settings.voice.provider === 'browser'}><Mic size={13} /> Tester la reconnaissance</button>
|
||||
</div>
|
||||
<div style={{ marginTop: 8 }}><Result t={sttTest} /></div>
|
||||
<div style={{ marginTop: 8 }}><TestResult t={sttTest} /></div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -381,7 +385,7 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
<div className="row" style={{ marginTop: 10 }}>
|
||||
<button className="btn small" onClick={testTts} disabled={settings.speech.provider === 'off'}><Volume2 size={13} /> Tester la voix</button>
|
||||
</div>
|
||||
<div style={{ marginTop: 8 }}><Result t={ttsTest} /></div>
|
||||
<div style={{ marginTop: 8 }}><TestResult t={ttsTest} /></div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -412,7 +416,7 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
</div>
|
||||
<div className="row">
|
||||
<button className="btn primary small" onClick={() => void applyWebhook()} disabled={!bridge()}>Appliquer et redémarrer</button>
|
||||
{hermesStore.webhook && <span className={`status-pill ${hermesStore.webhook.listening ? 'online' : 'offline'}`}>{hermesStore.webhook.listening ? `port ${hermesStore.webhook.port}` : hermesStore.webhook.error ?? 'inactif'}</span>}
|
||||
{hermesWebhook && <span className={`status-pill ${hermesWebhook.listening ? 'online' : 'offline'}`}>{hermesWebhook.listening ? `port ${hermesWebhook.port}` : hermesWebhook.error ?? 'inactif'}</span>}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -434,13 +438,13 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
<div className="theme-swatches">
|
||||
{(['arc', 'gold', 'crimson', 'emerald'] as HudTheme[]).map((t) => {
|
||||
const colors: Record<HudTheme, string> = { arc: '#34e4ff', gold: '#ffc35a', crimson: '#ff5c6c', emerald: '#4ef0a8' };
|
||||
return <button key={t} className={`swatch${settings.theme === t ? ' active' : ''}`} style={{ background: colors[t] }} title={t} onClick={() => update({ theme: t })} />;
|
||||
return <button key={t} className={`swatch${settings.theme === t ? ' active' : ''}`} style={{ background: colors[t] }} title={t} aria-label={`Thème ${t}`} aria-pressed={settings.theme === t} onClick={() => update({ theme: t })} />;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label>Raccourcis globaux</label>
|
||||
<span className="hint"><span className="kbd">Ctrl+Shift+Espace</span> micro · <span className="kbd">Ctrl+Shift+J</span> afficher/masquer · <span className="kbd">Ctrl+Shift+Échap</span> couper la voix</span>
|
||||
<span className="hint"><span className="kbd">Ctrl+Shift+Espace</span> micro · <span className="kbd">Ctrl+Shift+J</span> afficher/masquer · <span className="kbd">Ctrl+Alt+Échap</span> couper la voix · <span className="kbd">Ctrl+K</span> saisie</span>
|
||||
</div>
|
||||
<div className="divider" />
|
||||
<button className="btn danger small" onClick={() => { if (confirm('Réinitialiser tous les paramètres ?')) reset(); }}><RotateCcw size={13} /> Réinitialiser</button>
|
||||
|
||||
Reference in new issue
Block a user