J.A.R.V.I.S-rust/resources/commands/routines/coffee_break.lua
Bossiara13 bb2799ed8c
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
feat: Wave 8 — bedtime/morning/coffee routine packs
routines/good_night:
- Switch profile to "sleep" (silences idle banter overnight).
- Cancel one-shot timers (Таймер:/Timer:/Кухня:/Cooking: name prefix)
  so a forgotten 6-hour reminder doesn't wake the user up.
- Speak a varied 5-line RU/EN good night with cancelled-count suffix.
- Deliberately does NOT lock PC / shut displays — too destructive
  without an explicit confirm step.

routines/good_morning:
- Switch profile back to "default".
- Report scheduled task count for the day.
- Speak a varied 5-line greeting with agenda preview.

routines/coffee_break:
- Pause idle banter so Jarvis isn't talking to an empty chair.
- Schedule a 5-minute check-in via the persistent scheduler.
- Speak a varied 3-line acknowledgement.

Pack count: 97 → 98 (one pack, three commands).
Tests: 140 still pass.
2026-05-16 14:43:28 +03:00

31 lines
1.1 KiB
Lua

-- Coffee break — schedule a "вы вернулись?" check-in in 5 minutes, and
-- pause idle banter so Jarvis isn't talking to an empty chair.
local lang = jarvis.context.language
jarvis.banter.pause()
local check_in = lang == "ru"
and "Сэр, прошло пять минут. Вы вернулись?"
or "Sir, five minutes are up. Are you back?"
pcall(function()
jarvis.scheduler.add({
name = lang == "ru" and "Чек-ин после кофе" or "Coffee check-in",
schedule = "in 5 minutes",
action = { type = "speak", text = check_in },
})
end)
local lines_ru = {
"Хорошо, сэр. Возвращайтесь через пять.",
"Тихо в эфире пять минут. Удачно вам.",
"Пять минут — норма для кофе, не более.",
}
local lines_en = {
"Right, sir. Back in five.",
"Quiet for five. Good luck.",
"Five minutes for coffee — not more.",
}
local pool = (lang == "ru") and lines_ru or lines_en
return jarvis.cmd.ok(pool[math.random(#pool)])