-- 25 min focus → "перерыв" → 5 min break → "снова работа" → loop, until pomodoro.stop fires. -- Implemented as a chain of scheduled tasks that re-schedule themselves. -- Each cycle: 25 min work, then break notice, then 5 min break, then back to work. local pom_work = "pomodoro_work" local pom_break = "pomodoro_break" local script_path = jarvis.context.command_path .. "/tick.lua" script_path = script_path:gsub("/", "\\") -- clear any previous jarvis.scheduler.remove(pom_work) jarvis.scheduler.remove(pom_break) -- schedule the first "перерыв" notice in 25 min local ok, err = pcall(function() jarvis.scheduler.add({ id = pom_work, name = "Pomodoro work end", schedule = "in 25 minutes", action = { type = "lua", script_path = script_path }, }) end) if not ok then jarvis.log("warn", "pomodoro.start: " .. tostring(err)) jarvis.speak("Не получилось запустить.") jarvis.audio.play_error() return { chain = false } end -- mark the phase so tick.lua knows what to do next jarvis.state.set("pomodoro_phase", "work") jarvis.state.set("pomodoro_started_at", os.time()) jarvis.speak("Помодоро запущен. 25 минут работы.") jarvis.audio.play_ok() return { chain = false }