J.A.R.V.I.S-rust/crates/jarvis-core/src
Bossiara13 6729e53be6
Some checks are pending
Rust CI / cargo test (jarvis-core) (push) Waiting to run
Rust CI / cargo clippy (push) Waiting to run
Rust CI / cargo check (workspace) (push) Waiting to run
fix: TTS hot-swap actually works + GUI max-width + Python builder discoverable
ROOT CAUSE ANALYSIS

User reported: (a) TTS dropdown doesn't apply, (b) GUI feels stretched,
(c) no link to command builder, (d) Python doesn't even start.

Issues (a), (b), (c) addressed here. (d) addressed in python repo.

=== Fix A: TTS hot-swap (was completely broken) ===

Two distinct bugs:
1. `tts::init_backend()` only read JARVIS_TTS env var, NEVER consulted
   `Settings.tts_backend` in the DB. So saving "Silero" in the GUI
   dropdown changed nothing — not even on restart.
2. `BACKEND: OnceCell<...>` couldn't be replaced at runtime, so even
   if init had picked the right backend, the dropdown was useless
   mid-session.

Fixed:
- `tts::BACKEND` is now `Lazy<RwLock<Option<Arc<dyn TtsBackend>>>>`.
- `choose_backend_name()` resolves from DB → env → auto-detect.
- New `swap_to(name)` replaces the live backend atomically.
- IPC: new `IpcAction::SwitchTts { backend }`. jarvis-app reacts to
  it the same way it reacts to SwitchLlm.
- GUI's `set_tts_backend` now persists + hot-swaps GUI's TTS + Svelte
  page also fires `switchDaemonTts()` over WS so the running daemon
  installs the new backend.
- Removed "Применится при следующем запуске" hint — now applies
  immediately. RU + EN locale strings updated.

=== Fix B: GUI max-width ===

main + #header had no max-width, so on a 1920px monitor the labels
sprawled across 1860px of space, which felt stretched. Added
max-width: 1280px + margin: 0 auto + box-sizing: border-box. Smaller
windows are unaffected.

Also added the same cap on .app-container.assist-page so the home
screen arc reactor centres properly.

=== Fix C: Command builder discoverable ===

The Python fork ships a separate yaml-editing tool at
`python/tools/command_builder/` (pywebview GUI). No way to find it
from the main Rust GUI. Fixed:

- New tauri command `open_command_builder` (crates/jarvis-gui/src/
  tauri_commands/builder.rs). Locates the Python fork via
  $JARVIS_PYTHON_DIR → sibling python/ → C:\Jarvis\python, prefers
  the project's .venv, spawns `python -m tools.command_builder`.
- New blue "Конструктор команд (Python)" button on /settings page
  near the Save / Back buttons.

Tests: 140 rust + 104 python all pass. Release builds of jarvis-app
and jarvis-gui both green.
2026-05-24 22:12:04 +03:00
..
audio AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
audio_processing test: vad listening window timing 2026-04-23 11:08:02 +03:00
commands some fixes + gliner first implementation 2026-02-11 07:21:50 +05:00
config AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
db feat: Wave 3 — plugin system + custom wake-word trainer 2026-05-16 13:26:42 +03:00
i18n/locales fix: TTS hot-swap actually works + GUI max-width + Python builder discoverable 2026-05-24 22:12:04 +03:00
intent AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
ipc fix: TTS hot-swap actually works + GUI max-width + Python builder discoverable 2026-05-24 22:12:04 +03:00
listener feat: Wave 3 — plugin system + custom wake-word trainer 2026-05-16 13:26:42 +03:00
llm feat: real-Jarvis Wave 4 — personality, idle banter, persistent history, offline math, DDG search 2026-05-16 13:52:49 +03:00
lua feat: Wave 6 — focus mode, cooking timer, memory admin 2026-05-16 14:39:55 +03:00
models AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
recorder AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
slots AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
stt chore: CI workflows + drop Ukrainian (UA → just RU/EN) 2026-05-16 13:38:12 +03:00
time Tray options implementation + Voice system rewrite + build fixes 2026-01-07 23:29:46 +05:00
tts fix: TTS hot-swap actually works + GUI max-width + Python builder discoverable 2026-05-24 22:12:04 +03:00
voices Commands/voices multilanguage support + Ukranian vosk model added 2026-01-13 02:21:59 +05:00
audio.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
audio_buffer.rs VAD fixes + some calibrations 2026-01-08 00:35:21 +05:00
audio_processing.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
commands.rs feat: Wave 3 — plugin system + custom wake-word trainer 2026-05-16 13:26:42 +03:00
config.rs feat: Wave 5 — sysinfo speaks, smart reminders, outlook COM, time tracker, WOL, conversation tools 2026-05-16 14:34:29 +03:00
db.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
i18n.rs chore: CI workflows + drop Ukrainian (UA → just RU/EN) 2026-05-16 13:38:12 +03:00
idle_banter.rs feat: real-Jarvis Wave 4 — personality, idle banter, persistent history, offline math, DDG search 2026-05-16 13:52:49 +03:00
intent.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
ipc.rs test+feat: +37 tests (62→99) + intro/echo packs (5 new commands) 2026-05-15 18:28:11 +03:00
lib.rs feat: real-Jarvis Wave 4 — personality, idle banter, persistent history, offline math, DDG search 2026-05-16 13:52:49 +03:00
listener.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
long_term_memory.rs feat: Wave 6 — focus mode, cooking timer, memory admin 2026-05-16 14:39:55 +03:00
lua.rs basic Lua 5.4 implementation with few example commands 2026-01-17 05:46:38 +05:00
macros.rs test: +7 unit tests for llm::parse_backend + macros::Store serde 2026-05-15 17:30:24 +03:00
models.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
plugins.rs feat: Wave 3 — plugin system + custom wake-word trainer 2026-05-16 13:26:42 +03:00
profiles.rs refactor: maintainability pass — dedup, central env config, cmd helpers, tests, ARCHITECTURE.md 2026-05-15 16:06:18 +03:00
recorder.rs Improved wake-word & command detection, with dual mode 2026-02-08 06:37:39 +05:00
runtime_config.rs feat: real-Jarvis Wave 4 — personality, idle banter, persistent history, offline math, DDG search 2026-05-16 13:52:49 +03:00
scheduler.rs test+feat: +37 tests (62→99) + intro/echo packs (5 new commands) 2026-05-15 18:28:11 +03:00
slots.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
stt.rs feat(core): vad-driven listening window state machine 2026-04-23 11:07:35 +03:00
text_utils.rs test: +13 more tests (99→112), incl. live Ollama smoke (ignored by default) 2026-05-15 18:40:06 +03:00
time.rs Tray options implementation + Voice system rewrite + build fixes 2026-01-07 23:29:46 +05:00
voices.rs AI models shared registry + Code cleanup + Better async handling + Some fixes, etc 2026-02-18 21:08:48 +05:00
wake_trainer.rs feat: Wave 3 — plugin system + custom wake-word trainer 2026-05-16 13:26:42 +03:00