mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-14 18:56:55 +02:00
fix: bundle the Electron preload so the sandboxed bridge loads in packaged builds (v2.0.1)
The preload script imported ../shared/ipc at runtime; sandboxed preloads cannot require local modules, so window.eveflow was never exposed in the installed app and every request fell back to browser fetch (Failed to fetch, LOCALHOST metrics). Main and preload are now bundled with esbuild into single files in dist-electron/. Also: explicit error banner when the bridge is missing inside Electron, and a more precise connection test message (transport path, capabilities status). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
This commit is contained in:
7 files changed
+524
-10
No files matched your search
@@ -36,6 +36,10 @@ function useBoot(): boolean {
|
||||
void useHermes.getState().refreshWebhook();
|
||||
|
||||
const api = bridge();
|
||||
if (!api && /Electron/i.test(navigator.userAgent)) {
|
||||
useChat.getState().setError("Pont Electron indisponible : le script preload n'a pas été chargé. Réinstallez EveFlow ou consultez eveflow.log.");
|
||||
Log.error('app', 'window.eveflow missing inside Electron');
|
||||
}
|
||||
if (api) {
|
||||
disposers.push(api.hermes.onPush(handlePush));
|
||||
disposers.push(
|
||||
|
||||
@@ -60,11 +60,15 @@ export function SettingsDrawer({ onClose }: Props) {
|
||||
let caps = '';
|
||||
try {
|
||||
const c = await client.capabilities();
|
||||
caps = ` · ${String(c.model ?? '')} · ${Object.entries(c.features ?? {}).filter(([, v]) => v === true).length} fonctions`;
|
||||
} catch {
|
||||
caps = ' · capabilities indisponibles';
|
||||
caps = ` · modèle ${String(c.model ?? '?')} · ${Object.entries(c.features ?? {}).filter(([, v]) => v === true).length} fonctions`;
|
||||
} catch (err) {
|
||||
const message = (err as Error).message;
|
||||
caps = /404/.test(message)
|
||||
? ' · /v1/capabilities absent (Hermes ancien : transport chat completions)'
|
||||
: ` · capabilities : ${message}`;
|
||||
}
|
||||
setHermesTest({ status: 'ok', message: `${health.status}${caps}` });
|
||||
const via = bridge() ? 'via Electron' : 'via navigateur';
|
||||
setHermesTest({ status: 'ok', message: `${health.status} (${via})${caps}` });
|
||||
void hermesStore.connect();
|
||||
} catch (err) {
|
||||
setHermesTest({ status: 'fail', message: (err as Error).message });
|
||||
|
||||
Reference in new issue
Block a user