@mastra/libsql 0.13.8 → 0.13.9-alpha.0

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
@@ -1060,6 +1060,7 @@ var MemoryLibSQL = class extends MemoryStorage {
1060
1060
  threadId,
1061
1061
  selectBy
1062
1062
  }) {
1063
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
1063
1064
  const include = selectBy?.include;
1064
1065
  if (!include) return null;
1065
1066
  const unionQueries = [];
@@ -1105,10 +1106,12 @@ var MemoryLibSQL = class extends MemoryStorage {
1105
1106
  }
1106
1107
  async getMessages({
1107
1108
  threadId,
1109
+ resourceId,
1108
1110
  selectBy,
1109
1111
  format
1110
1112
  }) {
1111
1113
  try {
1114
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
1112
1115
  const messages = [];
1113
1116
  const limit = resolveMessageLimit({ last: selectBy?.last, defaultLimit: 40 });
1114
1117
  if (selectBy?.include?.length) {
@@ -1148,7 +1151,7 @@ var MemoryLibSQL = class extends MemoryStorage {
1148
1151
  id: "LIBSQL_STORE_GET_MESSAGES_FAILED",
1149
1152
  domain: ErrorDomain.STORAGE,
1150
1153
  category: ErrorCategory.THIRD_PARTY,
1151
- details: { threadId }
1154
+ details: { threadId, resourceId: resourceId ?? "" }
1152
1155
  },
1153
1156
  error
1154
1157
  );
@@ -1216,6 +1219,7 @@ var MemoryLibSQL = class extends MemoryStorage {
1216
1219
  }
1217
1220
  }
1218
1221
  try {
1222
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
1219
1223
  const currentOffset = page * perPage;
1220
1224
  const conditions = [`thread_id = ?`];
1221
1225
  const queryParams = [threadId];