Utility type to extract the parsed response type from a ResponseFormat strategy.
Maps ToolStrategy<T>, ProviderStrategy<T>, and TypedToolStrategy<T> to T
(the parsed output type), so that structuredResponse is correctly typed as the
schema's inferred type rather than the strategy wrapper.
When no responseFormat is provided (i.e. T defaults to the full
SupportedResponseFormat union), this resolves to ResponseFormatUndefined so
that structuredResponse is excluded from the agent's output state.
InferStructuredResponse: SupportedResponseFormat extends T ResponseFormatUndefined : T extends TypedToolStrategy<
U
> U : T extends ToolStrategy<U> U : T extends ProviderStrategy<U> U : ResponseFormatUndefinedtype T1 = InferStructuredResponse<ToolStrategy<{ city: string }>>; // { city: string }
type T2 = InferStructuredResponse<ProviderStrategy<{ answer: string }>>; // { answer: string }
type T3 = InferStructuredResponse<TypedToolStrategy<{ city: string }>>; // { city: string }
type T4 = InferStructuredResponse<SupportedResponseFormat>; // ResponseFormatUndefined (default/unset)