J.A.R.V.I.S-rust/resources/commands/routines/good_morning.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

45 lines
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- "Good morning" routine:
-- 1. switch active profile back to "default"
-- 2. count today's scheduled tasks
-- 3. reply with a varied morning greeting + agenda hint
local lang = jarvis.context.language
pcall(function() jarvis.profile.set("default") end)
local tasks_today = jarvis.scheduler.list() or {}
local n_tasks = #tasks_today
local lines_ru = {
"Доброе утро, сэр. Системы в порядке.",
"Доброе утро. Готов к новому дню.",
"С пробуждением, сэр. День в норме.",
"Доброе утро, сэр. Кофе сам себя не сварит.",
"Доброе утро. Все онлайн, рапорт по запросу.",
}
local lines_en = {
"Good morning, sir. All systems nominal.",
"Good morning. Ready for the day.",
"Welcome back, sir. The day looks normal.",
"Good morning, sir. The coffee won't brew itself.",
"Good morning. Everything online, ready when you are.",
}
local pool = (lang == "ru") and lines_ru or lines_en
local greeting = pool[math.random(#pool)]
local agenda
if n_tasks > 0 then
if lang == "ru" then
agenda = " В расписании " .. tostring(n_tasks) .. ", скажите 'покажи расписание', чтобы услышать."
else
agenda = " " .. tostring(n_tasks) .. " scheduled — say 'show schedule' for details."
end
else
if lang == "ru" then
agenda = " Расписание чистое."
else
agenda = " Schedule is clear."
end
end
return jarvis.cmd.ok(greeting .. agenda)