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:
25
main/heartbeat/heartbeat.h
Normal file
25
main/heartbeat/heartbeat.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* Initialize the heartbeat service (logs ready state).
|
||||
*/
|
||||
esp_err_t heartbeat_init(void);
|
||||
|
||||
/**
|
||||
* Start the heartbeat timer. Checks HEARTBEAT.md periodically
|
||||
* and sends a prompt to the agent if actionable tasks are found.
|
||||
*/
|
||||
esp_err_t heartbeat_start(void);
|
||||
|
||||
/**
|
||||
* Stop and delete the heartbeat timer.
|
||||
*/
|
||||
void heartbeat_stop(void);
|
||||
|
||||
/**
|
||||
* Manually trigger a heartbeat check (for CLI testing).
|
||||
* Returns true if the agent was prompted, false if no tasks found.
|
||||
*/
|
||||
bool heartbeat_trigger(void);
|
||||
Reference in New Issue
Block a user