feat: tier-1 parity — translate, math, theme toggle, projects, sound panel (56 commands total)

Mirrors the rust packs from the same iteration. yaml.safe_load + ast.parse
both pass.

main.py — six new action handlers + a _speak_in_lang helper:
+ do_translate: picks target language from "переведи на X" / "translate to X"
  triggers, defaults to English, sends to Groq with strict "translation only"
  prompt, drops to clipboard, speaks via SAPI in matching ISO voice
+ do_math_eval: strips trigger, Groq at temp=0.0 max_tokens=64,
  short-circuits on "нет" sentinel for non-math
+ do_theme_set: writes AppsUseLightTheme + SystemUsesLightTheme via
  Set-ItemProperty under HKCU\...\Themes\Personalize, action param
  mode: dark|light
+ do_open_project / do_list_projects: reads/creates
  %USERPROFILE%\Documents\jarvis-projects.json (a flat list of
  {name, path}), exact-match → substring-match, opens in VS Code if
  code.cmd on PATH else Explorer. First call writes a sample config
  pointing under USERPROFILE so it works on any host.
+ do_open_sound_panel: rundll32 mmsys.cpl,,1 — Recording tab

commands.yaml — 8 new entries:
+ translate, math_eval
+ theme_dark, theme_light (action params mode:dark/light)
+ open_project, list_projects
+ open_sound_panel

SAPI voice selection iterates GetInstalledVoices() and picks first
matching TwoLetterISOLanguageName — Russian phrases sound Russian,
English/German/etc. sound right too, falls back to default if no
matching voice is installed.

Total commands: 56 (was 49).
This commit is contained in:
Bossiara13 2026-05-15 12:06:44 +03:00
parent 7d83bf8299
commit 3795a0b4ec
2 changed files with 283 additions and 0 deletions

View file

@ -407,6 +407,68 @@ search_yandex:
- пробей в яндекс
action: {type: websearch, service: yandex}
translate:
phrases:
- переведи на английский
- переведи на русский
- переведи на украинский
- переведи на немецкий
- переведи на французский
- переведи на испанский
- переведи на китайский
- переведи на японский
- переведи
- как по английски
- как по русски
action: {type: translate}
math_eval:
phrases:
- посчитай
- сколько будет
- вычисли
- реши
- сколько это
action: {type: math_eval}
theme_dark:
phrases:
- тёмная тема
- темная тема
- включи тёмную тему
- тёмный режим
- темный режим
action: {type: theme_set, mode: dark}
theme_light:
phrases:
- светлая тема
- включи светлую тему
- светлый режим
action: {type: theme_set, mode: light}
open_project:
phrases:
- открой проект
- запусти проект
- открой папку проекта
action: {type: open_project}
list_projects:
phrases:
- какие у меня проекты
- список проектов
- покажи проекты
action: {type: list_projects}
open_sound_panel:
phrases:
- открой настройки звука
- панель звука
- настройки микрофона
- управление звуком
action: {type: open_sound_panel}
thanks:
phrases:
- спасибо