feat: Wave 3 — plugin system + custom wake-word trainer

#29 Plugin system:
- New jarvis-core::plugins module: discovers user packs in
  %APPDATA%\com.priler.jarvis\plugins\<name>\command.toml so authors can
  ship voice commands without rebuilding. Sandbox capped at "standard" —
  plugins cannot escalate to "full" (which would expose `os`). Disabled
  via a `disabled` flag file. Malformed packs warn and skip; never poison
  the rest of the list. 8 unit tests.
- commands::parse_commands() merges plugins into the loaded list.
- New /plugins GUI page with enable/disable switches, error reporting,
  "Open folder" button. Tauri commands plugins_list / plugins_set_enabled
  / plugins_open_folder. Header gets a "Плагины" button. i18n keys added
  for ru/en/ua.

#8 Custom wake-word trainer wizard:
- New jarvis-core::wake_trainer module: opens its own pv_recorder
  instance, records N short PCM clips, WAV-encodes them in memory, then
  calls rustpotter's WakewordRef::new_from_sample_buffers to train and
  persist a .rpw model under %APPDATA%/com.priler.jarvis/wake_words/.
  Keepsake WAVs are also dumped for retraining later. Sanitises names to
  block path traversal. 5 unit tests.
- Settings gain `custom_wake_word: String`; listener/rustpotter.rs now
  loads the user's selected model first and always falls back to the
  bundled default so the assistant keeps working even if the custom
  file is missing.
- New /wake-trainer GUI page: stepper UI for record-sample → train,
  shows recorded count, threshold slider, refuses to start while
  jarvis-app is running (mic exclusivity). Lists existing trained
  models with size + delete button.
- 8 Tauri commands wired through (status/defaults/start/record_sample/
  finish/cancel/list_models/delete_model).

Tests: 115 → 128 (+8 plugins +5 wake_trainer). Release builds green for
all three binaries (jarvis-app / jarvis-cli / jarvis-gui).
This commit is contained in:
Bossiara13 2026-05-16 13:26:42 +03:00
parent c4b22618f8
commit 4e21024509
17 changed files with 1625 additions and 24 deletions

View file

@ -93,9 +93,32 @@ LLM через Groq — выбор переключается **голосом**
| "Пауза" / "следующий трек" | Windows media keys (Spotify / YouTube / Foobar) |
| "Диагностика" / "доложи о себе" | Состояние всех бэкендов одной строкой |
Всего паков: **59** (`resources/commands/*/command.toml`).
Всего паков: **85** (`resources/commands/*/command.toml`) +
плагины пользователя из `%APPDATA%\com.priler.jarvis\plugins\`.
Полный список: GUI → /commands (с поиском и фильтрами).
### Плагины
Голосовые команды, которые лежат **вне** проекта. Каждый плагин —
папка с тем же `command.toml` + Lua-скриптами:
```
%APPDATA%\com.priler.jarvis\plugins\<имя>\
command.toml (тот же формат, что и встроенные паки)
*.lua (скрипты, на которые ссылается toml)
disabled (опционально — пустой файл, отключает плагин)
```
Подгружается при следующем старте `jarvis-app.exe`. Sandbox принудительно
понижается до `standard` — плагин не может попросить `full` (доступ к `os`).
GUI → /plugins показывает список, флажки enable/disable, кнопку «Открыть папку».
### Своё кодовое слово
GUI → /wake-trainer — мастер: запишите 530 примеров своего голоса,
обучите персональную `.rpw`-модель, выберите её в Настройках, перезапустите
ассистент. Файл — `%APPDATA%\com.priler.jarvis\wake_words\<имя>.rpw`.
## Быстрый старт
```powershell