J.A.R.V.I.S-rust/resources/commands
Bossiara13 5c7245012e feat: hot-swap LLM backend + media keys + codebase Q&A + scheduler cancel-by-text + TTS pre-warm
Single biggest user-facing change: you can now switch local↔cloud LLM by voice
without restarting. Plus four new packs and a perf nudge.

Shared LLM global (crates/jarvis-core/src/llm/mod.rs)
  - GLOBAL: Lazy<RwLock<Option<Arc<LlmClient>>>>. Single source of truth.
  - init_global() / current() / swap_to(LlmBackend) / current_backend_name() / parse_backend(str).
  - llm_fallback + llm_router migrated: they no longer own a separate LlmClient,
    they read from the global on each request. Hot-swap is now LIVE — change
    backend, next chat call uses the new one.
  - parse_backend accepts both english and russian aliases:
      "groq"/"cloud"/"облако"/"клауд"        → Groq
      "ollama"/"local"/"локал"/"локальный"  → Ollama

Voice + Lua LLM switcher (resources/commands/llm_switch/, 3 commands)
  - "переключись на локальный" / "перейди на оллама"  → swap to Ollama
  - "переключись на облако" / "используй грок"        → swap to Groq
  - "какой у тебя мозг" / "облако или локально"       → status query

  Underlying Lua API (registered globally):
    jarvis.llm({messages}, opts)   -- as before, now uses global client
    jarvis.llm_status()            -> "groq" | "ollama" | "none"
    jarvis.llm_switch(name)        -> name on success, nil on failure

Media keys pack (resources/commands/media_keys/, 4 commands)
  - "пауза" / "плей"           → VK_MEDIA_PLAY_PAUSE
  - "следующий трек"           → VK_MEDIA_NEXT_TRACK
  - "предыдущий трек"          → VK_MEDIA_PREV_TRACK
  - "стоп музыка"              → VK_MEDIA_STOP
  - Helper _media.ps1 uses user32.keybd_event (P/Invoke through Add-Type).
  - Works with anything that listens to global media keys: Spotify, Yandex Music,
    YouTube (focused tab), Foobar2000, Winamp, etc. No OAuth, no API keys.

Codebase Q&A pack (resources/commands/codebase_qa/, 3 commands)
  - "укажи проект <path>"             → stores path in jarvis.memory under codebase.root
  - "какой проект сейчас"             → speaks current path
  - "что делает функция X" / "найди в коде Y" / "объясни код"
    → walks the folder (depth 3, 30 files cap, 4KB per file, 50KB total),
      filters by source extensions (rs/py/ts/lua/go/...), feeds digest to LLM
      with a "senior reviewer" system prompt, speaks 3-5 sentence answer.

Scheduler cancel-by-text (crates/jarvis-core/src/scheduler.rs)
  - new pub fn find_by_text(query, limit) -> Vec<ScheduledTask>
  - new pub fn remove_by_text(query) -> usize (count removed)
  - new pure helper find_by_text_in(tasks, query, limit) for tests
  - Lua: jarvis.scheduler.{find_by_text, remove_by_text}
  - Voice: "отмени напоминание про воду" / "удали задачу про разминку"
  - 3 new unit tests (52 total in jarvis-core).

TTS pre-warm (crates/jarvis-app/src/main.rs)
  - Call jarvis_core::tts::backend() once on startup so the first speak()
    doesn't pay Piper binary discovery + voice loading cost. Cuts first-speak
    latency by ~150-300ms depending on backend.

Build: cargo build --release -p jarvis-app -p jarvis-gui both green.
Tests: 52/52 jarvis-core unit tests pass.
2026-05-15 16:15:59 +03:00
..
apps feat(commands): add PC control packs — volume, apps, file_search, output_device 2026-05-15 00:54:52 +03:00
brightness arch + features: jarvis.text API + brightness/window_switch/spelling/network/summarize (41 packs) 2026-05-15 13:11:18 +03:00
browser fix(commands): repair weather set_city schema, retire broken AHK browser pack 2026-05-15 00:54:34 +03:00
calculator project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
clipboard_read arch + features: Lua jarvis.speak() / jarvis.llm() API, /commands GUI page, games / mouse / random_choice packs 2026-05-15 12:58:16 +03:00
codebase_qa feat: hot-swap LLM backend + media keys + codebase Q&A + scheduler cancel-by-text + TTS pre-warm 2026-05-15 16:15:59 +03:00
codegen feat: LLM auto-fallback + codegen pack + OCR pack 2026-05-15 01:39:21 +03:00
counter basic Lua 5.4 implementation with few example commands 2026-01-17 05:46:38 +05:00
crypto feat(commands): analog-inspired tier-2 — news, currency, crypto, fun, wiki, power, help (33 packs) 2026-05-15 12:43:09 +03:00
currency feat: Ollama LLM backend + 5 utility packs (daily briefing, pomodoro, currency convert, stocks, habits, translate clipboard) 2026-05-15 15:51:24 +03:00
daily_briefing refactor: maintainability pass — dedup, central env config, cmd helpers, tests, ARCHITECTURE.md 2026-05-15 16:06:18 +03:00
date_query feat: 5 new packs + dotenvy + regen icon.ico + shortcuts redo 2026-05-15 12:28:44 +03:00
dice arch + features: Lua jarvis.speak() / jarvis.llm() API, /commands GUI page, games / mouse / random_choice packs 2026-05-15 12:58:16 +03:00
file_search feat(commands): add PC control packs — volume, apps, file_search, output_device 2026-05-15 00:54:52 +03:00
fun arch + features: Lua jarvis.speak() / jarvis.llm() API, /commands GUI page, games / mouse / random_choice packs 2026-05-15 12:58:16 +03:00
games arch + features: Lua jarvis.speak() / jarvis.llm() API, /commands GUI page, games / mouse / random_choice packs 2026-05-15 12:58:16 +03:00
habit_nudge refactor: maintainability pass — dedup, central env config, cmd helpers, tests, ARCHITECTURE.md 2026-05-15 16:06:18 +03:00
help feat(commands): analog-inspired tier-2 — news, currency, crypto, fun, wiki, power, help (33 packs) 2026-05-15 12:43:09 +03:00
jarvis project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
llm_switch feat: hot-swap LLM backend + media keys + codebase Q&A + scheduler cancel-by-text + TTS pre-warm 2026-05-15 16:15:59 +03:00
math feat(commands): tier-1 — translate, math, theme toggle, project opener, sound panel 2026-05-15 12:06:30 +03:00
media feat(commands): add media controls + system info packs 2026-05-15 01:19:30 +03:00
media_keys feat: hot-swap LLM backend + media keys + codebase Q&A + scheduler cancel-by-text + TTS pre-warm 2026-05-15 16:15:59 +03:00
memory_pack refactor: maintainability pass — dedup, central env config, cmd helpers, tests, ARCHITECTURE.md 2026-05-15 16:06:18 +03:00
mood_log refactor: maintainability pass — dedup, central env config, cmd helpers, tests, ARCHITECTURE.md 2026-05-15 16:06:18 +03:00
mouse arch + features: Lua jarvis.speak() / jarvis.llm() API, /commands GUI page, games / mouse / random_choice packs 2026-05-15 12:58:16 +03:00
network arch + features: jarvis.text API + brightness/window_switch/spelling/network/summarize (41 packs) 2026-05-15 13:11:18 +03:00
news feat(commands): analog-inspired tier-2 — news, currency, crypto, fun, wiki, power, help (33 packs) 2026-05-15 12:43:09 +03:00
notes feat(commands): tier-1 PC tools — window mgmt, clipboard, notes, process killer, web search 2026-05-15 11:27:02 +03:00
ocr feat: LLM auto-fallback + codegen pack + OCR pack 2026-05-15 01:39:21 +03:00
output_device feat(commands): add PC control packs — volume, apps, file_search, output_device 2026-05-15 00:54:52 +03:00
pomodoro refactor: maintainability pass — dedup, central env config, cmd helpers, tests, ARCHITECTURE.md 2026-05-15 16:06:18 +03:00
power feat(commands): analog-inspired tier-2 — news, currency, crypto, fun, wiki, power, help (33 packs) 2026-05-15 12:43:09 +03:00
process_kill feat(commands): tier-1 PC tools — window mgmt, clipboard, notes, process killer, web search 2026-05-15 11:27:02 +03:00
profile_switch feat: TTS backend abstraction + 4 'imba' features + Lua packs 2026-05-15 15:32:44 +03:00
projects feat(commands): tier-1 — translate, math, theme toggle, project opener, sound panel 2026-05-15 12:06:30 +03:00
random_choice arch + features: Lua jarvis.speak() / jarvis.llm() API, /commands GUI page, games / mouse / random_choice packs 2026-05-15 12:58:16 +03:00
reminders feat: 5 new packs + dotenvy + regen icon.ico + shortcuts redo 2026-05-15 12:28:44 +03:00
scheduler feat: hot-swap LLM backend + media keys + codebase Q&A + scheduler cancel-by-text + TTS pre-warm 2026-05-15 16:15:59 +03:00
sound_panel feat(commands): tier-1 — translate, math, theme toggle, project opener, sound panel 2026-05-15 12:06:30 +03:00
spelling arch + features: jarvis.text API + brightness/window_switch/spelling/network/summarize (41 packs) 2026-05-15 13:11:18 +03:00
steam project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
stocks feat: Ollama LLM backend + 5 utility packs (daily briefing, pomodoro, currency convert, stocks, habits, translate clipboard) 2026-05-15 15:51:24 +03:00
stop project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
stopwatch feat: 5 new packs + dotenvy + regen icon.ico + shortcuts redo 2026-05-15 12:28:44 +03:00
summarize arch + features: jarvis.text API + brightness/window_switch/spelling/network/summarize (41 packs) 2026-05-15 13:11:18 +03:00
sysinfo feat(commands): add media controls + system info packs 2026-05-15 01:19:30 +03:00
terminate project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
test_slots some fixes + gliner first implementation 2026-02-11 07:21:50 +05:00
theme feat(commands): tier-1 — translate, math, theme toggle, project opener, sound panel 2026-05-15 12:06:30 +03:00
translate feat: Ollama LLM backend + 5 utility packs (daily briefing, pomodoro, currency convert, stocks, habits, translate clipboard) 2026-05-15 15:51:24 +03:00
vision feat: TTS backend abstraction + 4 'imba' features + Lua packs 2026-05-15 15:32:44 +03:00
voice_type feat: 5 new packs + dotenvy + regen icon.ico + shortcuts redo 2026-05-15 12:28:44 +03:00
volume feat(commands): add PC control packs — volume, apps, file_search, output_device 2026-05-15 00:54:52 +03:00
weather fix(commands): repair weather set_city schema, retire broken AHK browser pack 2026-05-15 00:54:34 +03:00
websearch feat(commands): tier-1 PC tools — window mgmt, clipboard, notes, process killer, web search 2026-05-15 11:27:02 +03:00
wiki feat(commands): analog-inspired tier-2 — news, currency, crypto, fun, wiki, power, help (33 packs) 2026-05-15 12:43:09 +03:00
window feat(commands): tier-1 PC tools — window mgmt, clipboard, notes, process killer, web search 2026-05-15 11:27:02 +03:00
window_switch arch + features: jarvis.text API + brightness/window_switch/spelling/network/summarize (41 packs) 2026-05-15 13:11:18 +03:00
windows project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00