feat: add heartbeat service for periodic task checking

Adds a heartbeat timer that reads /spiffs/config/HEARTBEAT.md every 30
minutes and sends a prompt to the agent if actionable tasks are found.
Skips empty lines, headers, and completed checkboxes. Includes a
heartbeat_trigger CLI command for manual testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-09 01:23:13 +08:00
committed by Bo
parent dbab65bd47
commit ebff0ccb04
7 changed files with 224 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
#include "imu/imu_manager.h"
#include "rgb/rgb.h"
#include "cron/cron_service.h"
#include "heartbeat/heartbeat.h"
static const char *TAG = "mimi";
@@ -128,6 +129,7 @@ void app_main(void)
ESP_ERROR_CHECK(llm_proxy_init());
ESP_ERROR_CHECK(tool_registry_init());
ESP_ERROR_CHECK(cron_service_init());
ESP_ERROR_CHECK(heartbeat_init());
ESP_ERROR_CHECK(agent_loop_init());
/* Start Serial CLI first (works without WiFi) */
@@ -146,6 +148,7 @@ void app_main(void)
ESP_ERROR_CHECK(telegram_bot_start());
ESP_ERROR_CHECK(agent_loop_start());
cron_service_start();
heartbeat_start();
ESP_ERROR_CHECK(ws_server_start());
/* Outbound dispatch task */