Skip to content

Latest commit

 

History

History
43 lines (40 loc) · 3.46 KB

File metadata and controls

43 lines (40 loc) · 3.46 KB

@trigger.dev/ai

4.3.3

Added

  • Introduced a new @trigger.dev/ai package.
  • Added ai.tool(...) and ai.currentToolOptions() helpers for AI SDK tool ergonomics.
  • Added TriggerChatTransport / createTriggerChatTransport(...) for AI SDK useChat() 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 onTriggeredRun callbacks.
  • Added support for tuple-style header input normalization and typing.
  • Added reconnect lifecycle handling that cleans run state after completion/error and gracefully returns null when reconnect cannot be resumed.
  • Added explicit helper option types for chat send/reconnect request inputs.
  • Added optional onError callback support for observing non-fatal transport issues.
  • Added phase-aware onError reporting across send, stream-subscribe, reconnect, and stream-consumption paths.
  • Added normalization of non-Error throw values into Error instances before onError reporting.
  • 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 baseURL before endpoint normalization.
  • Added explicit validation that baseURL is non-empty after normalization.
  • Added explicit validation that baseURL is a valid absolute URL.
  • Added explicit validation that baseURL uses http or https.
  • Added explicit validation that baseURL excludes query parameters and hash fragments.
  • Added explicit validation that baseURL excludes username/password credentials.
  • Added explicit validation that baseURL excludes 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 throw baseURL 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 wrapper baseURL positions.
  • 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:// and HTTPS:// are accepted (case-insensitive protocol matching).
  • Added deterministic validation ordering for multi-issue baseURL values (internal whitespace → protocol → query/hash → credentials).
  • Documented explicit default baseURL value (https://api.trigger.dev) when omitted.