J.A.R.V.I.S-rust/resources/commands
Bossiara13 69a38b0d89 feat: LLM auto-fallback + codegen pack + OCR pack
LLM auto-fallback (jarvis-app/src/app.rs + jarvis-core/src/config.rs):
- When neither intent classifier nor levenshtein finds a command match,
  route the utterance straight to the LLM instead of just playing the
  "not found" sound. Triggers ("скажи X", "answer Y") still work and
  take precedence — they short-circuit before command lookup.
- Two new config knobs:
    LLM_AUTO_FALLBACK = true        — master toggle
    LLM_AUTO_FALLBACK_MIN_CHARS = 4 — suppress for very short utterances
                                       so background noise doesn't burn
                                       Groq quota
- Requires GROQ_TOKEN; if absent, behaviour is unchanged (play_not_found).

codegen/ command pack:
- Phrases: "напиши код X", "сгенерируй скрипт Y", "write code Z", etc.
- Strips the trigger from the recognized phrase, sends what remains to
  Groq with a strict system prompt ("return ONLY code, no fences, no
  commentary") at temperature 0.2.
- Parses the JSON content, unescapes \n / \" / \\ / \t, strips any
  remaining ```lang ... ``` fences, drops the result into the clipboard
  via jarvis.system.clipboard.set.
- Notifies a 120-char preview + plays ok-sound. Works for any language
  the model handles (Python by default if unspecified).
- GROQ_TOKEN / GROQ_MODEL / GROQ_BASE_URL read from env at call time —
  same envvars the voice-loop fallback already uses.

ocr/ command pack:
- Phrases: "прочитай экран", "что на экране", "read screen", etc.
- Captures the primary screen via System.Windows.Forms + System.Drawing
  to a temp PNG, then shells to tesseract.exe (-l rus+eng for ru/ua,
  -l eng for en).
- Resolves Tesseract by PATH first, then C:\Program Files\Tesseract-OCR
  and the x86 install dir; if none works the user gets a friendly
  "winget install UB-Mannheim.TesseractOCR" hint in a notification.
- Recognized text goes to clipboard + a 200-char preview notification.

All three features are portable (env-var resolution, no hardcoded user
paths). Command-pack total is now 11. cargo test -p jarvis-core --lib
commands::tests passes 3/3.
2026-05-15 01:39:21 +03:00
..
apps feat(commands): add PC control packs — volume, apps, file_search, output_device 2026-05-15 00:54:52 +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
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
file_search feat(commands): add PC control packs — volume, apps, file_search, output_device 2026-05-15 00:54:52 +03:00
jarvis project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
media feat(commands): add media controls + system info packs 2026-05-15 01:19:30 +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
steam project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00
stop project restructure with Rust workspaces 2026-01-04 05:19:47 +05: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
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
windows project restructure with Rust workspaces 2026-01-04 05:19:47 +05:00