feat(commands): add media controls + system info packs

media/ — play_pause, next, prev, stop via user32!keybd_event (VK_MEDIA_*
0xB0..0xB3). Helper _media_helper.ps1 mirrors the volume/ pack pattern,
so the same C# P/Invoke style works for the four standard media keys
without needing any external tooling. Catches Spotify, foobar, browsers,
Yandex Music PWA — anything that responds to system media keys.

sysinfo/ — battery / time / cpu / ram / disk and an "all" combo.
_sysinfo.ps1 uses CIM queries (Win32_Battery, Win32_OperatingSystem,
Win32_LogicalDisk, Win32_Processor + Win32_PerfFormattedData_PerfOS_
Processor) — no external deps. Time is rendered in ru-RU culture
("01:17, 15 мая, пятница"). Battery falls back to a friendly "no
battery, looks like a desktop" when Win32_Battery is empty. SystemDrive
env var resolves the right disk on non-C:/ installs.

Each sysinfo command notifies the line as a Windows toast and logs it.

Triggered locally: sysinfo_all currently reports:
  Сейчас: 01:17, 15 мая, пятница
  Батарея не обнаружена (видимо, десктоп)
  CPU: AMD Ryzen 7 5700X3D 8-Core Processor, загрузка 4%
  RAM: 23.4 из 47.9 ГБ (49% занято)
  Диск C:: свободно 118.2 из 1906.8 ГБ

Total command packs is now 9 (verified via jarvis-gui startup log).

Portability: all PowerShell helpers use $env:SystemDrive and CIM
classes that ship with every Windows install; Lua wrappers resolve
the helper path via jarvis.context.command_path (no hardcoded user
profile paths or absolute C:\ refs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bossiara13 2026-05-15 01:19:30 +03:00
parent 068ec860d3
commit 8c8c13167b
14 changed files with 474 additions and 0 deletions

View file

@ -0,0 +1,152 @@
[[commands]]
id = "sysinfo_battery"
type = "lua"
script = "battery.lua"
sandbox = "full"
timeout = 5000
[commands.phrases]
ru = [
"сколько заряда",
"сколько батарея",
"заряд батареи",
"сколько процентов",
]
en = [
"battery level",
"how much battery",
"battery status",
]
ua = [
"скільки заряду",
"заряд батареї",
]
[[commands]]
id = "sysinfo_time"
type = "lua"
script = "time.lua"
sandbox = "full"
timeout = 3000
[commands.phrases]
ru = [
"сколько времени",
"который час",
"сколько сейчас времени",
"какой день",
"какое сегодня число",
]
en = [
"what time is it",
"current time",
"what day is it",
"what is the date",
]
ua = [
"котра година",
"скільки часу",
"який сьогодні день",
]
[[commands]]
id = "sysinfo_cpu"
type = "lua"
script = "cpu.lua"
sandbox = "full"
timeout = 8000
[commands.phrases]
ru = [
"загрузка процессора",
"сколько процессор",
"нагрузка цпу",
"что с процессором",
]
en = [
"cpu load",
"cpu usage",
"how is cpu",
]
ua = [
"завантаження процесора",
"як процесор",
]
[[commands]]
id = "sysinfo_ram"
type = "lua"
script = "ram.lua"
sandbox = "full"
timeout = 5000
[commands.phrases]
ru = [
"сколько памяти",
"сколько оперативки",
"загрузка оперативки",
"сколько свободной памяти",
]
en = [
"how much ram",
"ram usage",
"memory usage",
]
ua = [
"скільки пам'яті",
"скільки оперативки",
]
[[commands]]
id = "sysinfo_disk"
type = "lua"
script = "disk.lua"
sandbox = "full"
timeout = 5000
[commands.phrases]
ru = [
"сколько свободно на диске",
"сколько места на диске",
"сколько места на жёстком",
"сколько свободно",
]
en = [
"free disk space",
"how much disk space",
"disk usage",
]
ua = [
"скільки вільно на диску",
"скільки місця на диску",
]
[[commands]]
id = "sysinfo_all"
type = "lua"
script = "all.lua"
sandbox = "full"
timeout = 10000
[commands.phrases]
ru = [
"статус системы",
"что с компьютером",
"состояние пк",
"что по системе",
"статус",
]
en = [
"system status",
"how is the system",
"pc status",
]
ua = [
"статус системи",
"стан пк",
]