@mastra/lance 0.2.11 → 0.2.12-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/CHANGELOG.md +15 -0
- package/dist/index.cjs +19 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mastra/lance
|
|
2
2
|
|
|
3
|
+
## 0.2.12-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6f5eb7a: Throw if an empty or whitespace-only threadId is passed when getting messages
|
|
8
|
+
- Updated dependencies [fd83526]
|
|
9
|
+
- Updated dependencies [d0b90ab]
|
|
10
|
+
- Updated dependencies [6f5eb7a]
|
|
11
|
+
- Updated dependencies [a01cf14]
|
|
12
|
+
- Updated dependencies [a9e50ee]
|
|
13
|
+
- Updated dependencies [5397eb4]
|
|
14
|
+
- Updated dependencies [c9f4e4a]
|
|
15
|
+
- Updated dependencies [0acbc80]
|
|
16
|
+
- @mastra/core@0.16.0-alpha.0
|
|
17
|
+
|
|
3
18
|
## 0.2.11
|
|
4
19
|
|
|
5
20
|
### 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
|
-
|
|
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
|
-
|
|
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
|
/**
|