- Introduced a new
@trigger.dev/aipackage. - Added
ai.tool(...)andai.currentToolOptions()helpers for AI SDK tool ergonomics. - Added
TriggerChatTransport/createTriggerChatTransport(...)for AI SDKuseChat()integrations powered by Trigger.dev tasks and Realtime Streams v2. - Added rich default chat payload typing (
chatId,trigger,messageId,messages, request context) and mapper hooks for custom payloads. - Added support for async payload mappers, async trigger option resolvers, and async
onTriggeredRuncallbacks. - Added support for tuple-style header input normalization and typing.
- Added reconnect lifecycle handling that cleans run state after completion/error and gracefully returns
nullwhen reconnect cannot be resumed. - Added explicit helper option types for chat send/reconnect request inputs.
- Added optional
onErrorcallback support for observing non-fatal transport issues. - Added phase-aware
onErrorreporting across send, stream-subscribe, reconnect, and stream-consumption paths. - Added normalization of non-Error throw values into Error instances before
onErrorreporting. - Added best-effort run-store cleanup so cleanup failures do not mask root transport errors.
- Improved best-effort run-store cleanup to attempt both inactive-state writes and deletes even if one step fails.