@mastra/client-js 1.41.0-alpha.13 → 1.41.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5715,9 +5715,11 @@ function hydrateThread(thread) {
5715
5715
  updatedAt: toDate(thread.updatedAt)
5716
5716
  };
5717
5717
  }
5718
- /** The stream carries every timestamp as an ISO string; give consumers back the `Date`s the type promises. */
5719
- function hydrateEventTimestamps(event) {
5720
- if (!isKnownAgentControllerEvent(event)) return event;
5718
+ function isKnownParsedEvent(event) {
5719
+ return KNOWN_AGENT_CONTROLLER_EVENT_TYPES.has(event.type);
5720
+ }
5721
+ /** The stream carries every timestamp as an ISO string; give consumers back the `Date`s {@link Hydrated} promises. */
5722
+ function hydrateKnownEvent(event) {
5721
5723
  switch (event.type) {
5722
5724
  case "message_start":
5723
5725
  case "message_update":
@@ -5732,6 +5734,9 @@ function hydrateEventTimestamps(event) {
5732
5734
  default: return event;
5733
5735
  }
5734
5736
  }
5737
+ function hydrateEventTimestamps(event) {
5738
+ return isKnownParsedEvent(event) ? hydrateKnownEvent(event) : event;
5739
+ }
5735
5740
  /**
5736
5741
  * A session bound to a `resourceId` within one agent controller. Sessions are
5737
5742
  * get-or-create on the server, so re-creating the same resourceId (and scope)