# `Squidie.Runtime.AgentRecovery`
[🔗](https://github.com/dark-trench/squidie/blob/main/lib/squidie/runtime/agent_recovery.ex#L1)

Restart recovery coordinator for Jido-native workflow and dispatch agents.

The coordinator rebuilds both agents from durable journals, then drains the
two restart-safe recovery windows in order: missing dispatch intents first,
completed dispatch results second.

# `queue`

```elixir
@type queue() :: Squidie.Runtime.DispatchAgent.queue() | atom()
```

# `recovery_update`

```elixir
@type recovery_update() :: %{
  workflow_agent: Jido.Agent.t(),
  dispatch_agent: Jido.Agent.t(),
  scheduled_runnables: [map()],
  applied_attempts: [Squidie.Runtime.DispatchProtocol.ActionAttempt.t()]
}
```

# `storage_config`

```elixir
@type storage_config() :: Squidie.Runtime.Journal.storage_config()
```

# `recover`

```elixir
@spec recover(
  storage_config(),
  Squidie.Runtime.WorkflowAgent.run_id(),
  queue(),
  keyword()
) ::
  {:ok, recovery_update()} | {:error, term()}
```

Rebuilds a workflow agent and dispatch agent, then drains restart recovery.

Planned runnable dispatch recovery runs before completed result recovery so a
restart observes all durable workflow intent before applying durable dispatch
outcomes back to the run thread.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
