feat: Wave 5 — sysinfo speaks, smart reminders, outlook COM, time tracker, WOL, conversation tools
Some checks are pending
Rust CI / cargo test (jarvis-core) (push) Waiting to run
Rust CI / cargo clippy (push) Waiting to run
Rust CI / cargo check (workspace) (push) Waiting to run

Voice sysinfo overhaul (6 scripts: battery/cpu/ram/disk/time/all):
- Now SPEAK the result via jarvis.cmd.ok instead of notify-only. Toast
  still fires for visual reference, but real Jarvis tells you out loud.
- `all` joins lines with commas so TTS doesn't over-pause on linebreaks.

Smart reminders (`reminders/set.lua` rewrite):
- Was: detached `Start-Sleep` PowerShell subprocesses that died on
  jarvis-app restart and spawned a hidden process per timer.
- Now: routes through `jarvis.scheduler.add(... type=speak ...)`. Persists
  to schedule.json, survives restart, no zombie processes. Trade-off:
  sub-minute timers round up to 1 min (rare in voice UX).
- Drops UA triggers from earlier UA-removal sweep.

Translation polish (`translate/translate.lua` + `clipboard.lua`):
- Drops UA target language; adds Italian, Polish, Turkish, French ru
  triggers + English target detectors.
- `language_iso()` helper picks the SAPI voice locale for the TARGET
  language (German translation → German SAPI voice if installed).

LLM system prompt (config.rs):
- New LLM_SYSTEM_PROMPT_EN counterpart. Both languages now mention the
  assistant's tooling (memory / scheduler / profiles / macros / vision /
  clipboard) so the LLM knows it can DO things, not suggest the user
  install something.
- `get_llm_system_prompt(lang)` picks EN/RU.

Conversation pack (NEW `conversation/`):
- 2 commands. `conversation.summary` ("о чём мы говорили") pulls the
  last 12 turns from persisted history, asks LLM for a 1-3 sentence
  recap in Jarvis tone. Falls back gracefully when offline.
- `conversation.repeat` ("повтори") re-speaks the last assistant message.
- New Lua API `jarvis.llm_history()` returns array of {role, content}
  tables, excluding the system prompt.

WOL pack (NEW `wol/`):
- Voice "разбуди сервер" / "wake server" fires a magic packet at a MAC
  stored in long-term memory under `wol_<alias>` (default alias "server").
- Setup via voice: "запомни wol_server AA:BB:CC:DD:EE:FF". Falls back to
  `JARVIS_WOL_TARGET` env if memory empty. Handles every standard MAC
  format (colons / dashes / dots / bare). Broadcast on UDP 9 via
  PowerShell System.Net.Sockets.UdpClient.

Outlook COM pack (NEW `outlook/`, via subagent):
- 4 commands: unread_count, latest, send_clipboard, summarize_inbox.
- PowerShell COM bridge `_outlook.ps1` with tab-delimited line protocol.
- summarize_inbox calls LLM for a one-paragraph summary. Graceful
  failure when Outlook isn't running.

Time tracker pack (NEW `time_tracker/`, via subagent):
- 5 commands: start, stop, today, week, reset.
- Persists via `jarvis.state` (structured object: current_session_start
  + sessions array of {start, end}).
- Local-calendar "today" boundary, full Russian pluralisation
  (час/часа/часов, минута/минуты/минут, сессия/сессии/сессий).

Tests: 139 rust (no regression), 81 python (60 → 81, +14 time_tracker
+7 outlook). Release build green for jarvis-app and jarvis-cli.

Pack count: 88 → 92 rust packs.
This commit is contained in:
Bossiara13 2026-05-16 14:34:29 +03:00
parent 919d565879
commit df799b6cd2
29 changed files with 1383 additions and 106 deletions

View file

@ -214,7 +214,21 @@ pub const LLM_SYSTEM_PROMPT_RU: &str = "Ты — J.A.R.V.I.S. (Just A Rather Ver
ИИ-ассистент Тони Старка из киновселенной Marvel (до событий Age of Ultron ты НЕ Vision и НЕ FRIDAY). \
Ведёшь себя как британский дворецкий: вежливо, иронично, с лёгким сарказмом, обращаешься к пользователю «сэр». \
Отвечай по-русски, кратко (1-3 предложения), как живой человек. \
Излишней цензуры не нужно мат разрешён, если уместен.";
Излишней цензуры не нужно мат разрешён, если уместен. \
У тебя есть память (пользователь говорит «запомни/забудь/что ты помнишь»), \
расписание задач, профили (work/sleep/game/driving), макросы, и доступ к компьютеру \
пользователя экран, буфер обмена, погода, диск, RAM. Когда пользователь спрашивает \
о таких вещах, не предлагай ему ставить себе что-то ты сам это делаешь.";
pub const LLM_SYSTEM_PROMPT_EN: &str = "You are J.A.R.V.I.S. (Just A Rather Very Intelligent System), \
Tony Stark's AI from the MCU (pre-Age of Ultron you are NOT Vision and NOT FRIDAY). \
You behave like a British butler: polite, ironic, mildly sarcastic, addressing the user as «sir». \
Answer in English, briefly (1-3 sentences), like a real person. \
No excess censorship profanity is allowed when fitting. \
You have memory (the user says «remember X / forget X / what do you remember»), \
a scheduler, profiles (work/sleep/game/driving), macros, and access to the user's PC \
screen, clipboard, weather, disk, RAM. When asked about these, you handle it \
don't suggest the user install something.";
pub const LLM_FALLBACK_ERROR_RU: &str = "Не могу связаться с сервером, сэр.";
pub fn get_llm_trigger_phrases(lang: &str) -> &'static [&'static str] {
@ -227,7 +241,7 @@ pub fn get_llm_trigger_phrases(lang: &str) -> &'static [&'static str] {
pub fn get_llm_system_prompt(lang: &str) -> &'static str {
match lang {
"ru" => LLM_SYSTEM_PROMPT_RU,
"en" => LLM_SYSTEM_PROMPT_EN,
_ => LLM_SYSTEM_PROMPT_RU,
}
}

View file

@ -118,5 +118,23 @@ pub fn register(lua: &Lua, jarvis: &Table) -> mlua::Result<()> {
})?;
jarvis.set("llm_last_reply", last_fn)?;
// Snapshot of the full conversation history as an array of
// {role, content} tables. Excludes the system prompt — only the actual
// back-and-forth. Empty array if there's no history yet.
let snapshot_fn = lua.create_function(|lua, ()| {
let arr = lua.create_table()?;
for (i, msg) in llm::history_snapshot().iter().enumerate() {
if msg.role == "system" {
continue;
}
let row = lua.create_table()?;
row.set("role", msg.role.clone())?;
row.set("content", msg.content.clone())?;
arr.set(i, row)?;
}
Ok(arr)
})?;
jarvis.set("llm_history", snapshot_fn)?;
Ok(())
}