# `Jido.Agent.Schedules`
[🔗](https://github.com/agentjido/jido/blob/v2.3.0/lib/jido/agent/schedules.ex#L1)

Utilities for expanding agent-level schedule declarations.

Agent schedules are declared in `use Jido.Agent, schedules: [...]` and
target signal types that get routed through `signal_routes/1`.

## Schedule Formats

- `{"* * * * *", "signal.type"}` - Cron expression + signal type
- `{"* * * * *", "signal.type", job_id: :my_job}` - With explicit job ID
- `{"* * * * *", "signal.type", job_id: :my_job, timezone: "America/New_York"}` - With timezone

## Job ID Namespacing

Job IDs are namespaced as tuples: `{:agent_schedule, agent_name, signal_type_or_job_id}`

# `schedule_spec`

```elixir
@type schedule_spec() :: %{
  cron_expression: String.t(),
  action: nil,
  job_id: {:agent_schedule, String.t(), term()},
  signal_type: String.t(),
  timezone: String.t()
}
```

Expanded agent schedule specification (same shape as plugin schedule specs).

# `expand_schedules`

```elixir
@spec expand_schedules(list(), String.t()) :: [schedule_spec()]
```

Expands agent schedule declarations into schedule specs.

## Examples

    iex> expand_schedules([{"* * * * *", "heartbeat.tick", job_id: :hb}], "my_agent")
    [%{cron_expression: "* * * * *", action: nil, job_id: {:agent_schedule, "my_agent", :hb}, signal_type: "heartbeat.tick", timezone: "Etc/UTC"}]

# `schedule_routes`

```elixir
@spec schedule_routes([schedule_spec()]) :: []
```

Returns an empty list of routes for agent schedule signal types.

Agent schedules target signal types (not action modules directly),
so the user must define matching routes in `signal_routes/1`.
No automatic routes are generated.

