@mastra/redis 1.4.4 → 1.4.5

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
@@ -940,6 +940,7 @@ var StoreMemoryRedis = class extends MemoryStorage {
940
940
  const threadKey = getKey(TABLE_THREADS, { id: newThreadId });
941
941
  multi.set(threadKey, JSON.stringify(processRecord(TABLE_THREADS, newThread).processedRecord));
942
942
  const clonedMessages = [];
943
+ const messageIdMap = Object.create(null);
943
944
  const targetResourceId = resourceId || sourceThread.resourceId;
944
945
  const newThreadMessagesKey = getThreadMessagesKey(newThreadId);
945
946
  for (let i = 0; i < sourceMessages.length; i++) {
@@ -964,11 +965,13 @@ var StoreMemoryRedis = class extends MemoryStorage {
964
965
  value: newMessageId
965
966
  });
966
967
  clonedMessages.push(newMessage);
968
+ messageIdMap[sourceMsg.id] = newMessageId;
967
969
  }
968
970
  await multi.exec();
969
971
  return {
970
972
  thread: newThread,
971
- clonedMessages
973
+ clonedMessages,
974
+ messageIdMap
972
975
  };
973
976
  } catch (error) {
974
977
  if (error instanceof MastraError) throw error;