Bossiara13
6a328077bc
feat: vision + macros + scheduler in Python (129 → 142 commands)
...
Three big rust packs ported. Python parity now covers the FULL imba lineup
except codebase_qa and github_pr.
vision_handler.py (new, ~125 lines)
- Screenshot via PowerShell System.Drawing → temp PNG → base64 → Groq
vision API (llama-3.2-11b-vision-preview, override via GROQ_VISION_MODEL).
- do_vision_describe "что на экране" / "опиши экран"
- do_vision_read_error "прочитай ошибку"
- Requires GROQ_TOKEN; speaks "Не удалось" on missing.
macros_store.py (new, ~170 lines)
- JSON store at <here>/macros.json (atomic write-through).
- start(name) / save() / cancel() / replay(name, dispatch_fn)
- is_recording / recording_name / list_names / get / delete
- record_step(phrase) called by execute_cmd hook (see main.py)
- is_macro_control filter blocks "запиши макрос ..." from recording itself
(no infinite recursion).
- replay spawns daemon thread, fires each step with 800ms delay.
scheduler_store.py (new, ~220 lines)
- JSON store at <here>/schedule.json.
- parse_schedule(spec) handles "daily HH:MM", "at HH:MM",
"every/in N minutes|hours|seconds" — Russian (минут/час/секунд) + English.
- Background daemon thread ticks every 30s, fires Speak actions through the
same speak callback used by main.py.
- Once-tasks auto-delete after firing; daily/interval cycle forever.
- add/remove/clear/remove_by_text/list_all.
extensions.py (+13 handlers)
do_vision_describe / do_vision_read_error → thin proxies to vision_handler
do_macros_start / save / cancel / replay / list / delete
do_scheduler_add_reminder / add_recurring / list / clear / cancel_by_text
main.py
- extensions.init_background_services() at startup → scheduler thread boots.
- Wraps execute_cmd so every successful dispatch feeds macros_store.record_step.
- set_dispatch_fn(_execute_phrase_for_macro) enables macro replay through the
normal command pipeline (recognize_cmd → execute_cmd).
commands.yaml (+13 entries, 129 → 142)
vision_describe, vision_read_error, macros_start, macros_save, macros_cancel,
macros_replay, macros_list, macros_delete, scheduler_reminder,
scheduler_recurring, scheduler_list, scheduler_clear, scheduler_cancel_text.
Tests: ast.parse passes for all five .py files. yaml.safe_load = 142 entries.
Python parity status vs rust (72 packs):
✓ memory_pack, profile_switch, vision, scheduler, macros, llm switch
(via env), llm_context (basic), media_keys (existing), screenshot, net_info,
unit_convert, generators, disk, date_math, sleep_timer (via shutdown),
interesting_fact, mailto, self_check, ssl_check, intro/echo
✗ codebase_qa, github_pr (require gh CLI + file walk — TODO)
✗ pomodoro / daily_briefing / habit_nudge / quick_search / diagnostics
(could be ported but need scheduler integration + LLM glue)
2026-05-16 00:00:22 +03:00
Bossiara13
02c6f2f90d
feat: memory_store + profiles_store + 10 new yaml entries (119 → 129)
...
Mirrors `long_term_memory` and `profiles` modules from rust fork.
memory_store.py (new, ~95 lines)
- JSON store at <here>/long_term_memory.json (atomic write).
- remember(key, value) / recall(key) / forget(key) / search(query, limit) /
all_facts() / build_llm_context(prompt, limit).
- Uses the same JSON shape as the rust side, so the file is
interoperable if you ever symlink the two installations to the same dir.
profiles_store.py (new, ~145 lines)
- Profiles at <here>/profiles/<name>.json. active_profile.txt persists.
- Seeds 5 defaults on first init: default ★, work 💼 , game 🎮 , sleep 🌙 ,
driving 🚗 — same as rust fork.
- active() / active_name() / set_active(name) / list_names() /
allows_command(cmd_id).
extensions.py (+6 handlers, +160 lines)
- do_memory_remember — derives key (first 6 words or split on '=')
- do_memory_recall — substring search or top-3 if no query
- do_memory_forget — exact then substring fallback
- do_memory_list — count + first 5 keys
- do_profile_set — target via action.target or voice ("работа" → work)
- do_profile_what — speaks current profile + description
main.py
- +6 dispatch entries for the new action types.
commands.yaml (+10 entries, 119 → 129)
- memory_remember, memory_recall, memory_forget, memory_list
- profile_work, profile_game, profile_sleep, profile_driving, profile_default
- profile_what
Tests: ast.parse passes for all .py files. yaml.safe_load gives 129 entries.
Python parity is now meaningful: memory + profiles are usable by voice
without any rust install. Still missing for full parity: scheduler (needs
background thread), macros (needs phrase-capture state), vision (needs
Groq vision model call), codebase_qa, github_pr.
2026-05-15 23:54:33 +03:00
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