Commit graph

81 commits

Author SHA1 Message Date
Bossiara13
b3a5bcabe5 feat: parity — games, mouse, random_choice + new packs (90 commands)
Mirrors the rust feature/pc-tools work. yaml.safe_load + ast.parse pass.
82 → 90 commands (+8).

main.py:
+ do_launch_game / do_list_games: reads ~/Documents/jarvis-games.json
  (creates sample on first call with dota / cs2 / elden ring / witcher
  3 / factorio entries). Fuzzy name+alias match, launches via
  steam://rungameid/<appid> (webbrowser.open), epic_uri, or
  cmd /c start "" path.
+ do_mouse: action param op = left|right|middle|double|scroll_up|
  scroll_down. Embedded PowerShell P/Invokes user32!mouse_event with
  the right flag pairs.
+ do_random_choice: strips trigger, splits on " или " / " or " / ", " /
  " либо " / " чи ", picks one with random.choice.

commands.yaml +8 entries:
+ launch_game / list_games
+ mouse_left_click / mouse_right_click / mouse_double_click /
  mouse_scroll_up / mouse_scroll_down (all action:mouse, op:...)
+ random_choice
2026-05-15 12:58:32 +03:00
Bossiara13
40a46567b8 feat: parity — news, currency, crypto, fun, wiki, power, help (82 commands)
Mirrors the rust analog-inspired tier-2 packs. yaml + ast smoke pass.
56 → 82 commands (+26 yaml entries; 14 of them are power/fun/wiki/
news/etc. permutations).

main.py — 7 new action handlers, all built on stdlib urllib.request
(no new dep). Helper _http_get() with User-Agent header so RSS feeds
that 403 default UAs go through.

+ do_news: pulls RSS (default Lenta.ru), extracts <title> via regex,
  skips channel title (idx 0), takes 5, sends to Groq for a 2-3
  sentence summary at temp 0.4. Falls back to reading first 3
  headlines verbatim if no token.
+ do_currency_rate: cbr-xml-daily.ru daily_json.js. Recognises
  USD/EUR/CNY/GBP/JPY/KZT in the phrase, computes value/nominal,
  diffs against Previous, speaks Russian with direction.
+ do_crypto_price: CoinGecko simple/price for BTC/ETH/SOL/DOGE/TON
  with 24h change, picked by phrase keywords.
+ do_fun_ask: joke / fact / quote / compliment via Groq at temp 1.0
  with per-kind system prompts, random seed in user message.
+ do_wiki_lookup: ru.wikipedia opensearch → page summary, optional
  Groq retell when extract > 350 chars.
+ do_power: dispatch table for shutdown / restart / sleep /
  hibernate / logoff / cancel — runs shutdown.exe /s|/r|/h|/l|/a
  or rundll32 powrprof,SetSuspendState. 30-second grace on shutdown
  and restart with /c message so "отмени выключение" works.
+ do_help_commands: sorts VA_CMD_LIST.keys(), speaks first 12 + total,
  full list to clipboard.

commands.yaml +26 entries:
news_headlines, currency_rate, crypto_price, joke / fact / quote /
compliment (action:fun_ask, kind: ...), wiki_lookup, shutdown_pc /
restart_pc / sleep_pc / hibernate_pc / logoff_user / cancel_shutdown
(action:power, op: ...), help.

Inspired by what mainstream voice assistants (Siri/Alexa/Алиса/
Cortana) ship by default + power-user utilities (shutdown,
window/process control).
2026-05-15 12:43:26 +03:00
Bossiara13
5790ca18af feat: parity — reminders, today/tomorrow/yesterday, voice type, dice, stopwatch (67 commands)
Mirrors the rust feature/pc-tools work. yaml.safe_load + ast.parse pass.
Commands count: 56 → 67 (+11).

main.py:
+ do_set_reminder — strips trigger, parses "N (секунд|минут|часов)"
  with Russian-word numeral support (один/две/пять/десять/...).
  Spawns a daemon thread that time.sleep()s then runs tts.va_speak
  + PowerShell WScript.Shell.Popup. Defaults to 5 min when number/
  unit are missing.
+ do_date_query — accepts {offset: 0/1/-1}, computes target date with
  datetime.timedelta, formats with hardcoded Russian weekday/month
  names (no locale dependency), speaks "Сегодня/Завтра/Вчера + ...".
+ do_type_text — clipboard + pyautogui.hotkey('ctrl', 'v') so it
  works in any focused window.
+ do_dice — coin/dice/random via random.choice / random.randint.
+ do_stopwatch — stores start ts in
  %LOCALAPPDATA%\com.priler.jarvis\stopwatch.txt; start/check/stop
  ops with humanised elapsed string.

commands.yaml +11 entries:
+ set_reminder
+ today / tomorrow / yesterday (action: date_query, offset: 0/1/-1)
+ type_text
+ coin_flip / roll_dice / random_number (action: dice, kind: ...)
+ stopwatch_start / stopwatch_check / stopwatch_stop
  (action: stopwatch, op: start/check/stop)
2026-05-15 12:28:57 +03:00
Bossiara13
69359ed5c0 feat: "Python edition" startup banner + one-click run.bat launcher
main.py: prints a 3-line banner at startup with name, version, edition
label ("Python edition") and the command count from the loaded YAML.
Makes the console window self-identifying when both python and rust
forks run simultaneously.

run.bat at repo root: cd /d into repo, sets the cmd title to
"J.A.R.V.I.S. (Python edition)", picks the venv interpreter at
.venv\Scripts\python.exe if present (falls back to system python),
runs main.py, then pauses at exit so the user can read any traceback
instead of the console window vanishing on crash.

Desktop shortcut "Jarvis (Python).lnk" points at this batch file
with the project icon (the rust fork's icon.ico, since python has
no .ico of its own).
2026-05-15 12:12:21 +03:00
Bossiara13
3795a0b4ec 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).
2026-05-15 12:06:44 +03:00
Bossiara13
7d83bf8299 feat: tier-1 PC tools parity — window mgmt, clipboard, notes, process killer, web search
Mirrors the new rust packs from the same iteration. Total commands in
commands.yaml is now 49 (was 33). yaml.safe_load + ast.parse both pass.

Window management (8 commands) — uses the existing `keys` action with
pyautogui hotkey strings: winleft+d (show_desktop), winleft+up/down
(maximize/minimize), winleft+left/right (snap left/right), alt+f4
(close_window), winleft+shift+m (restore_all), winleft+tab (task_view).
No new action type needed.

Clipboard read aloud — new clipboard_read action. Shells to
PowerShell Get-Clipboard, caps preview at 400 chars, speaks via the
existing tts.va_speak (which already handles recorder.stop/start).

Notes — new notes_add + notes_open actions. notes_add strips the
trigger phrase, appends "[YYYY-MM-DD HH:MM] body\n" to
%USERPROFILE%\Documents\jarvis-notes.txt, creates the dir if needed.
notes_open shells "cmd /c start" so .txt opens in the user-default
editor.

Process killer — new process_kill action. Strips the trigger ("убей
процесс"/"закрой программу"/etc.), looks up the remainder in the same
alias map as the rust version (хром→chrome, телега→telegram, спотифай
→spotify, едж/эдж/edge→msedge, дискорд→discord, стим→steam, обс→obs64,
проводник/блокнот/калькулятор/диспетчер задач, vs code→code, etc.),
appends .exe if needed, runs taskkill /F /IM, speaks success or
"не нашёл процесс N".

Web search — new websearch action with a `service` param. Bases:
google → https://www.google.com/search?q=
youtube → https://www.youtube.com/results?search_query=
wiki → https://ru.wikipedia.org/wiki/Special:Search?search=
yandex → https://yandex.ru/search/?text=
Strips trigger, urllib.parse.quote-s the rest, opens via webbrowser.open
(respects the user'\''s default browser; config.BROWSER_PATHS only kicks in
for the older url-action commands).

Portability: USERPROFILE used for notes path, no other hardcoded paths.
2026-05-15 11:27:19 +03:00
Bossiara13
80a685230c feat: parity with rust fork — LLM auto-fallback + 6 new action types + 20+ commands
Brings the python fork in line with the new feature/pc-tools work that
landed in rust. Same UX, same trigger phrases, same env vars.

config.py:
  + LLM_AUTO_FALLBACK = True
  + LLM_AUTO_FALLBACK_MIN_CHARS = 4
    Mirrors the rust config knobs. The old "скажи X" trigger still works
    (VA_TBR strips it before intent matching, so what remains hits this
    fallback anyway) — but now ANY unrecognized query goes to Groq, not
    just "скажи" ones.

main.py:
  va_respond: replaced the fuzz-on-"скажи" gate with a unified auto-
  fallback that fires whenever no command matches, GROQ_TOKEN is set,
  and the utterance is at least LLM_AUTO_FALLBACK_MIN_CHARS long.

  + _speak(text): recorder.stop() → tts.va_speak → start, used by the
    new action handlers so the mic doesn't pick up the assistant.
  + _set_clipboard(text): subprocess to PowerShell Set-Clipboard, no
    new python deps.
  + _strip_trigger(voice, triggers): shared helper for codegen/file_search
    where we need the text AFTER the trigger phrase.

  New action handlers (registered in run_action dispatch):
  + groq_codegen — extracts query, calls Groq with strict "code only"
    system prompt at temp 0.2, strips ```lang ... ``` fences, puts the
    result in the clipboard, speaks "Код в буфере, сэр. Строк: N".
  + ocr_screen — PowerShell System.Drawing screenshot to a temp PNG,
    shells to tesseract.exe (-l rus+eng), speaks a 120-char preview,
    clipboard. Looks for tesseract on PATH first then standard install
    dirs; gives a clear "Tesseract не установлен" if missing.
  + sysinfo — CIM-based battery/cpu/ram/disk via PS one-liners, time
    via python datetime (gets us localized weekday for free). Topics:
    time / battery / cpu / ram / disk / all.
  + file_search — strips trigger, recursive Get-ChildItem in Desktop/
    Documents/Downloads (depth 3, top 5), opens explorer /select on
    the first hit, speaks count and basename.
  + audio_devices_panel — opens mmsys.cpl. Proper COM-based device
    switching (like the rust IPolicyConfig version) is deferred — TODO
    in backlog.

commands.yaml:
  Total 33 commands (was 19). New:
  + open_notepad / open_calculator / open_explorer / open_terminal
    / open_settings / open_task_manager / lock_screen / screenshot
    — all via shell action (no AHK exes needed).
  + volume_up / volume_down — five chained keys=volumeup/volumedown
    presses each, like rust's _volume_helper.ps1 with Times=5.
  + media_stop — keys=stop.
  + sysinfo_time / sysinfo_battery / sysinfo_cpu / sysinfo_ram /
    sysinfo_disk / sysinfo_all — sysinfo action.
  + file_search, codegen, read_screen, switch_audio_device.

  Replaced (were AHK exes that Priler ships and we don't have):
  ~ music → keys playpause
  ~ music_off → keys playpause (toggle)
  ~ music_next → keys nexttrack
  ~ music_prev → keys prevtrack

  Removed (Priler hardware/setup specific, can't sensibly port):
  - gaming_mode_on / gaming_mode_off (display config switch)
  - music_save (depends on the specific player AHK was driving)
  - switch_to_headphones / switch_to_dynamics (replaced with the
    generic switch_audio_device that opens mmsys.cpl)

  Kept as-is (worked already, no AHK dependency):
  open_browser / open_youtube / open_google (url action)
  sound_off / sound_on (pycaw via system.volume_mute/unmute)
  thanks / stupid / off

Smoke-tested: yaml.safe_load → 33 commands, ast.parse main.py → OK.

Portability: USERPROFILE for screenshot path, $env:SystemDrive for disk,
PATH lookup for tesseract before falling back to standard install dirs.
No hardcoded user-specific paths.
2026-05-15 01:48:34 +03:00
Bossiara13
53678fbdfa Release v0.4.1 — browser choice for url-action 2026-04-27 20:06:58 +03:00
Bossiara13
b8fc7b4eb7 chore: bump VA_VER to 0.4.1 2026-04-27 20:06:52 +03:00
Bossiara13
d0eac79275 Merge feature/browser-choice-in-url into dev 2026-04-27 20:06:51 +03:00
Bossiara13
a4171ec6b1 feat(url): optional browser field (yandex/chrome/firefox/edge)
Adds optional 'browser' field to url-action; runtime resolves it via
config.BROWSER_PATHS (subprocess.Popen with the chosen exe). When
omitted, falls back to webbrowser.open (system default). Constructor
GUI gains a browser dropdown on URL action and on multi-step URL.
Existing open_browser/youtube/google updated to use yandex by default
since user prefers Yandex Browser.
2026-04-27 20:06:26 +03:00
Bossiara13
47927fcf41 Release v0.4.0 — semantic intent (ONNX MiniLM) + optional denoise 2026-04-23 11:09:54 +03:00
Bossiara13
d22a35c9c7 chore: bump VA_VER to 0.4.0 2026-04-23 11:09:48 +03:00
Bossiara13
59aece53da Merge feature/onnx-intent-and-denoise into dev
Replaces fuzzywuzzy intent matching with ONNX MiniLM-L6-v2 sentence
embeddings (cosine similarity, threshold 0.45). Now triggers on
semantically equivalent phrases not literally in commands.yaml.
Adds optional noisereduce preprocessing before Vosk (off by default,
DENOISE_ENABLED config flag). Inference latency: 2.5ms median CPU.
2026-04-23 11:09:46 +03:00
Bossiara13
8655b4fc69 docs: README — semantic intent + denoise 2026-04-23 10:55:07 +03:00
Bossiara13
cc3fa60c28 chore: pin onnxruntime / tokenizers / noisereduce in requirements 2026-04-23 10:54:38 +03:00
Bossiara13
13370da5b7 feat: optional noisereduce preprocessing before vosk 2026-04-23 10:54:20 +03:00
Bossiara13
6a710c55b8 feat: onnx intent classifier replacing fuzzy match 2026-04-23 10:53:18 +03:00
Bossiara13
9cb55f4730 chore: vendor MiniLM-L6-v2 onnx model from Qdrant 2026-04-23 10:51:53 +03:00
Bossiara13
31a2dd1a6c chore: enable git lfs for .onnx files 2026-04-23 10:51:29 +03:00
Bossiara13
e7d4304a62 Release v0.3.0 — TTS effects + GUI command constructor 2026-04-23 02:17:09 +03:00
Bossiara13
1eaaf9eddc Merge feature/command-builder into dev
GUI command constructor (pywebview, Russian, dark theme matching
Rust GUI palette). 3-step stepper + LLM-suggest tab. Writes to
commands.yaml with ruamel-preserved comments and .bak backup.
Three new action types: shell / url / keys (pyautogui-based).
2026-04-23 02:17:02 +03:00
Bossiara13
e86906801a Merge feature/ai-style-postproc into dev
Optional bandpass + short reverb on Silero TTS output. Off by default
(TTS_EFFECTS_ENABLED in config.py). Preview script in utils/.
2026-04-23 02:17:02 +03:00
Bossiara13
fbfe3a7ff6 chore: bump VA_VER to 0.3.0 2026-04-23 02:13:49 +03:00
Bossiara13
b535d025f3 docs: command builder README + user-facing README section + run_builder.bat 2026-04-23 02:13:47 +03:00
Bossiara13
521b124f05 feat(ui): keyboard nav (Enter advances step) + yaml-health warning on launch 2026-04-23 02:13:43 +03:00
Bossiara13
0b1604e018 feat(tools): llm-suggest via groq with JSON response format 2026-04-23 02:11:45 +03:00
Bossiara13
e4d4bf7a08 feat(ui): steps 1-3 (trigger / action / params) with live YAML preview 2026-04-23 02:11:01 +03:00
Bossiara13
232490d9fa chore: vendor js-yaml.min.js 2026-04-23 02:10:57 +03:00
Bossiara13
9814181d1a feat(tools): pywebview bootstrap + python bridge API
Single window (900x720, dark background) loading web/index.html with a
Python bridge exposing list_existing_commands, list_exes,
list_sound_names, preview_sound, slugify, validate_draft, save_command,
plus llm_suggest hook for M3. Sound preview spawned on a daemon thread
so the GUI does not block.
2026-04-22 23:21:20 +03:00
Bossiara13
80d9eedead chore: add ruamel.yaml + pyautogui deps
ruamel.yaml is needed by tools/command_builder/yaml_writer to round-trip
commands.yaml without losing comments. pyautogui drives the new keys
action. pywebview is added now too so M2's GUI bootstrap can land
without another deps bump.
2026-04-22 23:17:44 +03:00
Bossiara13
7b8cd31cf3 feat: add shell / url / keys action types to runtime dispatcher
shell uses subprocess (with shell=True so user can write a normal
command line); url uses webbrowser.open; keys uses pyautogui.hotkey
for combinations or pyautogui.typewrite for raw text. pyautogui is
imported lazily so the bot still starts on machines without a GUI.
2026-04-22 23:17:40 +03:00
Bossiara13
0f6b794db9 feat(tools): yaml writer with ruamel (preserves comments, atomic + backup)
Uses ruamel.yaml so existing comments / formatting in commands.yaml
survive a save. Each write creates commands.yaml.bak first, then
atomically renames a .tmp file into place. Tests cover round-trip for
all action types plus comment-preservation on append.
2026-04-22 23:17:24 +03:00
Bossiara13
68e73b3c53 feat(tools): scaffold command builder schema
Dataclass-based schema mirroring commands.yaml plus new action types
(shell, url, keys). Round-trip dict<->dataclass with validation.
Russian-aware slugify for auto-generating command IDs.
2026-04-22 23:17:17 +03:00
Bossiara13
f9e1e2468f chore: gitignore voice_ref/ and sound/_*.wav experiments 2026-04-22 23:10:54 +03:00
Bossiara13
e5903d8076 docs: README — TTS effects section 2026-04-22 20:00:04 +03:00
Bossiara13
34f5cd4f5a chore: add utils/preview_effects.py for A/B comparison 2026-04-22 19:59:45 +03:00
Bossiara13
64ad7b963e feat: wire effects into va_speak behind config.TTS_EFFECTS_ENABLED 2026-04-22 19:58:42 +03:00
Bossiara13
bd6bc294ad feat: add tts effects module (bandpass + reverb + optional pitch) 2026-04-22 19:58:20 +03:00
Bossiara13
f45ac77a2e Release v0.2.0 — VAD + YAML plugin commands 2026-04-22 19:43:57 +03:00
Bossiara13
4f3b827a47 Merge feature/vad-and-yaml-plugins into dev
Adds webrtcvad-based smart command-end detection (fixed 10s window
replaced by VAD with configurable silence/min/max thresholds) and
migrates execute_cmd to a YAML-driven plugin system with typed
actions (exe, play_sound, system, multi, sleep). 17 commands
migrated; all original behavior preserved.
2026-04-22 19:43:52 +03:00
Bossiara13
7855c5da37 docs: README — document VAD + YAML plugin schema 2026-04-22 19:35:45 +03:00
Bossiara13
63cb64ef21 chore: update commands.yaml to new action schema
All 17 voice commands migrated from a flat phrase list to the
phrases/action shape. Behaviour preserved 1:1 with the previous
elif chain — including the 200ms post-Popen pause for music_*
controls and the 500ms pause before the 'ready' chime on the
audio-device switch commands.
2026-04-22 19:35:16 +03:00
Bossiara13
a1a2be309b refactor: drive execute_cmd from commands.yaml action schema
Replaces the 100-line elif chain with a small dispatcher. Each entry in
commands.yaml now carries both 'phrases' (existing trigger list) and
'action' describing how to run it. Action types: exe, play_sound,
system (volume_mute/unmute/exit), sleep, multi.

The data migration lives in the next commit; the dispatcher in this
commit assumes the new schema.
2026-04-22 19:34:00 +03:00
Bossiara13
794d923bf9 feat: add webrtcvad-based smart command-end detection
Replace the fixed 10s post-wake-word listen window with a VAD-driven
loop. Once at least 500ms of speech have been seen, 1.2s of silence
closes the window. Hard cap at 15s as a safety net.

Tunable in config.py via VAD_AGGRESSIVENESS, COMMAND_END_SILENCE_MS,
COMMAND_MIN_SPEECH_MS, COMMAND_MIN_LISTEN_MS, COMMAND_MAX_LISTEN_MS.
2026-04-22 19:32:30 +03:00
Bossiara13
1c1c63e5f0 Release v0.1.0 — first usable Jarvis fork (Groq + Vosk wake-word, no Picovoice) 2026-04-22 17:50:47 +03:00
Bossiara13
277921ce14 Merge feature/vosk-wakeword into dev — kills Picovoice dep 2026-04-22 17:50:38 +03:00
Bossiara13
6dc8a85bf6 Merge feature/rebrand-and-groq into dev 2026-04-22 17:50:37 +03:00
Bossiara13
dfdfd9418b feat: tighten system prompt — explicit Jarvis persona, not Friday/Vision
- Names the assistant as J.A.R.V.I.S. (acronym + MCU pre-Age-of-Ultron)
- British butler tone, addresses user as «сэр»
- Brief replies (1-3 sentences)
- No prudish censorship
2026-04-22 17:50:32 +03:00
Bossiara13
d56a096267 chore: align VA_VER with v0.1.0 release tag 2026-04-22 17:49:26 +03:00