Internal behavior for AgentServer lifecycle hooks.
Allows instance managers and other orchestrators to inject attachment tracking, idle timeouts, and storage-backed persistence without polluting the core runtime.
@type event() :: :attach | :detach | :touch | :idle_timeout | {:down, reference(), pid()}
@type state() :: map()
@callback handle_event(event :: term(), server_state :: map()) :: {:cont, map()} | {:stop, reason :: term(), map()}
@callback init(opts :: keyword(), server_state :: map()) :: map()
@callback persist_cron_specs(server_state :: map(), cron_specs :: map()) :: :ok | {:error, term()}
@callback terminate(reason :: term(), server_state :: map()) :: :ok