Infer the state type from an agent, graph, or direct state type.
Detection order:
~agentTypes) → InferAgentState~RunOutput) → Extract RunOutput~OutputType) → Extract OutputTypeInferStateType: T extends __type InferAgentState<
T
> : T extends __type S extends Record<string,