- 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.
- Added reconnect cleanup error reporting for stale inactive state while still returning
null. - Added retry semantics for stale inactive reconnect cleanup on subsequent reconnect attempts.
- Added consistent baseURL normalization for trigger and stream endpoints (including path prefixes and trailing slashes).
- Added surrounding-whitespace trimming for
baseURLbefore endpoint normalization. - Added explicit validation that
baseURLis non-empty after normalization. - Added explicit validation that
baseURLis a valid absolute URL. - Added explicit validation that
baseURLuseshttporhttps. - Added explicit validation that
baseURLexcludes query parameters and hash fragments. - Added explicit validation that
baseURLexcludes username/password credentials. - Added explicit validation that
baseURLexcludes internal whitespace/invisible separator characters (including zero-width/BOM characters). - Clarified that invisible separator characters are rejected even when wrapped around an otherwise valid
baseURL. - Added explicit test/docs coverage for additional unicode-trimmable wrappers (
\u1680,\u3000) and confirmed empty-after-trim values still throwbaseURL must not be empty. - Expanded unicode whitespace coverage with
\u2007(figure space) and\u205F(medium mathematical space) across internal-whitespace rejection, wrapper trimming acceptance, and empty-after-trim validation. - Expanded invisible-separator coverage to reject
\u180E(mongolian vowel separator) in both internal and wrapperbaseURLpositions. - Expanded unicode space coverage to include
\u200A(hair space),\u2009(thin space),\u2008(punctuation space),\u2006(six-per-em space), and\u2003(em space) across wrapper-trimming acceptance and internal-whitespace rejection scenarios. - Documented that
HTTP://andHTTPS://are accepted (case-insensitive protocol matching). - Added deterministic validation ordering for multi-issue baseURL values (internal whitespace → protocol → query/hash → credentials).
- Documented explicit default
baseURLvalue (https://api.trigger.dev) when omitted.