- Introduced a new cron job system allowing users to schedule automated tasks via the CLI, supporting one-time reminders and recurring jobs.
- Added commands for managing cron jobs: `/cron` to list jobs, `/cron add` to create new jobs, and `/cron remove` to delete jobs.
- Implemented job storage in `~/.hermes/cron/jobs.json` with output saved to `~/.hermes/cron/output/{job_id}/{timestamp}.md`.
- Enhanced the CLI and README documentation to include detailed usage instructions and examples for cron job management.
- Integrated cron job tools into the hermes-cli toolset, ensuring they are only available in interactive CLI mode.
- Added support for cron expression parsing with the `croniter` package, enabling flexible scheduling options.
37 lines
769 B
Python
37 lines
769 B
Python
"""
|
|
Cron job scheduling system for Hermes Agent.
|
|
|
|
This module provides scheduled task execution, allowing the agent to:
|
|
- Run automated tasks on schedules (cron expressions, intervals, one-shot)
|
|
- Self-schedule reminders and follow-up tasks
|
|
- Execute tasks in isolated sessions (no prior context)
|
|
|
|
Usage:
|
|
# Run due jobs (for system cron integration)
|
|
python -c "from cron import tick; tick()"
|
|
|
|
# Or via CLI
|
|
python cli.py --cron-daemon
|
|
"""
|
|
|
|
from cron.jobs import (
|
|
create_job,
|
|
get_job,
|
|
list_jobs,
|
|
remove_job,
|
|
update_job,
|
|
JOBS_FILE,
|
|
)
|
|
from cron.scheduler import tick, run_daemon
|
|
|
|
__all__ = [
|
|
"create_job",
|
|
"get_job",
|
|
"list_jobs",
|
|
"remove_job",
|
|
"update_job",
|
|
"tick",
|
|
"run_daemon",
|
|
"JOBS_FILE",
|
|
]
|