AgentItem<TOutput> contract.
Item types
AgentItem<TOutput> is a discriminated union:
Render a streamed timeline
TypeScript narrows each item from itstype:
Read items after completion
The completed result contains the same ordered item shapes:Access provider-specific data
Provider output is normalized into portable item types. When an integration still needs a provider-specific field, normalized provider items retain the original payload inrawProviderItem.
Keep product logic on the portable fields where possible. Treat rawProviderItem as an escape hatch for provider-specific integrations, not as the default application contract.