feat: add cron scheduled task service with tool_use integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-09 01:02:33 +08:00
committed by Bo
parent 680f41133a
commit dbab65bd47
10 changed files with 744 additions and 2 deletions

22
main/tools/tool_cron.h Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
#include "esp_err.h"
#include <stddef.h>
/**
* Add a scheduled cron job.
* Input JSON: { name, schedule_type ("every"/"at"), interval_s, at_epoch, message, channel?, chat_id? }
*/
esp_err_t tool_cron_add_execute(const char *input_json, char *output, size_t output_size);
/**
* List all scheduled cron jobs.
* Input JSON: {} (no required fields)
*/
esp_err_t tool_cron_list_execute(const char *input_json, char *output, size_t output_size);
/**
* Remove a scheduled cron job by ID.
* Input JSON: { job_id }
*/
esp_err_t tool_cron_remove_execute(const char *input_json, char *output, size_t output_size);