Bossiara13
|
f82427c7b6
|
feat: extensions module + 19 new commands (100 → 119)
Mirror of new packs from the rust fork. Self-contained `extensions.py` with
new do_* handlers, registered via 'set_speak' / 'set_clipboard_fn' callbacks
from main.py.
Wiring (main.py)
- `import extensions` at top.
- `extensions.set_speak(_speak)` + `extensions.set_clipboard_fn(_set_clipboard)`
right after _set_clipboard is defined.
- Added 15 new action-type dispatches in run_action.
extensions.py (new, ~360 lines)
Action types:
lock_workstation → rundll32 user32.dll,LockWorkStation
screenshot {mode} → clipboard via System.Windows.Forms.Clipboard.SetImage
OR file → ~/Pictures/Screenshots/jarvis-<ts>.png
disk_free / disk_list → PowerShell Get-PSDrive
coin_flip / uuid_gen / password_gen (length 6..64, copies to clipboard,
speaks length only — never echoes the password)
ssl_check {domain} → PowerShell TCP+SslStream→X509Certificate2 expiry
wifi_ssid → netsh wlan show interfaces parser (ru + en field names)
public_ip → urllib request to api.ipify.org
unit_convert {mode: length|weight|temperature|speed}
Russian-grammar pluralisation (фут/фута/футов).
date_math {mode: days_until|day_of_week}
Recognises Новый год, Рождество, 8 марта, 9 мая + "до N <месяц>".
echo_repeat / self_ping — debug commands
interesting_fact → Groq LLM (requires GROQ_TOKEN)
commands.yaml — 19 new entries:
lock_workstation, screenshot_clipboard, screenshot_file, disk_free, disk_list,
coin_flip, password_gen, uuid_gen, ssl_check, wifi_ssid, public_ip,
convert_length, convert_weight, convert_temperature, convert_speed,
days_until, day_of_week, echo_repeat, self_ping, interesting_fact.
Tests: python syntax check + yaml.safe_load both pass. Total commands: 119.
NOT YET mirrored from rust (would require deeper rework):
memory_pack / profile_switch / scheduler / macros / vision / codebase_qa
/ github_pr / llm_switch / llm_context / media_keys / mood_log / pomodoro
/ habit_nudge / daily_briefing / quick_search / diagnostics / sleep_timer
/ wikipedia (the rewritten one) / intro / mailto / generators (UUID, coin,
password ARE included — others can follow).
The reason these weren't mirrored: they need new state files
(memory.json, profiles.json, schedule.json, macros.json) and background
threads (scheduler tick). Doable as a follow-up but out of scope here.
|
2026-05-15 23:51:13 +03:00 |
|