@mastra/lance 0.2.11 → 0.3.0-alpha.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @mastra/lance
2
2
 
3
+ ## 0.3.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 376913a: Update peerdeps of @mastra/core
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [8fbf79e]
12
+ - @mastra/core@0.16.0-alpha.1
13
+
14
+ ## 0.2.12-alpha.0
15
+
16
+ ### Patch Changes
17
+
18
+ - 6f5eb7a: Throw if an empty or whitespace-only threadId is passed when getting messages
19
+ - Updated dependencies [fd83526]
20
+ - Updated dependencies [d0b90ab]
21
+ - Updated dependencies [6f5eb7a]
22
+ - Updated dependencies [a01cf14]
23
+ - Updated dependencies [a9e50ee]
24
+ - Updated dependencies [5397eb4]
25
+ - Updated dependencies [c9f4e4a]
26
+ - Updated dependencies [0acbc80]
27
+ - @mastra/core@0.16.0-alpha.0
28
+
3
29
  ## 0.2.11
4
30
 
5
31
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -403,6 +403,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
403
403
  threadConfig
404
404
  }) {
405
405
  try {
406
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
406
407
  if (threadConfig) {
407
408
  throw new Error("ThreadConfig is not supported by LanceDB storage");
408
409
  }
@@ -443,7 +444,11 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
443
444
  {
444
445
  id: "LANCE_STORE_GET_MESSAGES_FAILED",
445
446
  domain: error.ErrorDomain.STORAGE,
446
- category: error.ErrorCategory.THIRD_PARTY
447
+ category: error.ErrorCategory.THIRD_PARTY,
448
+ details: {
449
+ threadId,
450
+ resourceId: resourceId ?? ""
451
+ }
447
452
  },
448
453
  error$1
449
454
  );
@@ -614,13 +619,11 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
614
619
  return Array.from(allIndices).sort((a, b) => a - b).map((index) => records[index]);
615
620
  }
616
621
  async getMessagesPaginated(args) {
622
+ const { threadId, resourceId, selectBy, format = "v1" } = args;
623
+ const page = selectBy?.pagination?.page ?? 0;
624
+ const perPage = selectBy?.pagination?.perPage ?? 10;
617
625
  try {
618
- const { threadId, resourceId, selectBy, format = "v1" } = args;
619
- if (!threadId) {
620
- throw new Error("Thread ID is required for getMessagesPaginated");
621
- }
622
- const page = selectBy?.pagination?.page ?? 0;
623
- const perPage = selectBy?.pagination?.perPage ?? 10;
626
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
624
627
  const dateRange = selectBy?.pagination?.dateRange;
625
628
  const fromDate = dateRange?.start;
626
629
  const toDate = dateRange?.end;
@@ -722,14 +725,21 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
722
725
  hasMore: total > (page + 1) * perPage
723
726
  };
724
727
  } catch (error$1) {
725
- throw new error.MastraError(
728
+ const mastraError = new error.MastraError(
726
729
  {
727
730
  id: "LANCE_STORE_GET_MESSAGES_PAGINATED_FAILED",
728
731
  domain: error.ErrorDomain.STORAGE,
729
- category: error.ErrorCategory.THIRD_PARTY
732
+ category: error.ErrorCategory.THIRD_PARTY,
733
+ details: {
734
+ threadId,
735
+ resourceId: resourceId ?? ""
736
+ }
730
737
  },
731
738
  error$1
732
739
  );
740
+ this.logger?.trackException?.(mastraError);
741
+ this.logger?.error?.(mastraError.toString());
742
+ return { messages: [], total: 0, page, perPage, hasMore: false };
733
743
  }
734
744
  }
735
745
  /**