{
  "version": "s14",
  "title": "Cron Scheduler",
  "description": "A daemon loop watches durable cron definitions, queues due jobs, and lets the agent process them.",
  "steps": [
    {
      "type": "user_message",
      "content": "Every weekday morning, remind me to review open tasks.",
      "annotation": "The user asks for a recurring future action."
    },
    {
      "type": "assistant_text",
      "content": "I'll create a cron job and store it so the scheduler can pick it up later.",
      "annotation": "The agent delegates recurrence to the scheduler instead of relying on current context."
    },
    {
      "type": "tool_call",
      "toolName": "schedule_cron",
      "content": "{\"name\":\"review-open-tasks\",\"cron\":\"0 9 * * 1-5\",\"prompt\":\"Review open tasks and summarize blockers.\"}",
      "annotation": "The new tool validates and persists a cron definition."
    },
    {
      "type": "tool_result",
      "toolName": "schedule_cron",
      "content": "Scheduled review-open-tasks with id cron_7.",
      "annotation": "The job is written to the durable schedule store."
    },
    {
      "type": "system_event",
      "content": "cron_scheduler_loop: cron_7 matched current minute -> cron_queue.put(cron_7)",
      "annotation": "The independent scheduler daemon detects that the job is due."
    },
    {
      "type": "system_event",
      "content": "queue_processor_loop: dequeued cron_7 and invoked agent_loop(prompt)",
      "annotation": "A separate processor turns due jobs into normal agent work."
    },
    {
      "type": "assistant_text",
      "content": "Scheduled. When the cron fires, the queue processor will run the reminder prompt through the agent loop.",
      "annotation": "The final answer explains the durable recurring behavior."
    }
  ]
}
