@mastra/lance 1.0.0-beta.3 → 1.0.0-beta.4
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 +31 -0
- package/dist/index.cjs +93 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +94 -89
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +30 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -91,7 +91,7 @@ async function getTableSchema({
|
|
|
91
91
|
} catch (validationError) {
|
|
92
92
|
throw new error.MastraError(
|
|
93
93
|
{
|
|
94
|
-
id: "
|
|
94
|
+
id: storage.createStorageErrorId("LANCE", "GET_TABLE_SCHEMA", "INVALID_ARGS"),
|
|
95
95
|
domain: error.ErrorDomain.STORAGE,
|
|
96
96
|
category: error.ErrorCategory.USER,
|
|
97
97
|
text: validationError.message,
|
|
@@ -114,7 +114,7 @@ async function getTableSchema({
|
|
|
114
114
|
} catch (error$1) {
|
|
115
115
|
throw new error.MastraError(
|
|
116
116
|
{
|
|
117
|
-
id: "
|
|
117
|
+
id: storage.createStorageErrorId("LANCE", "GET_TABLE_SCHEMA", "FAILED"),
|
|
118
118
|
domain: error.ErrorDomain.STORAGE,
|
|
119
119
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
120
120
|
details: { tableName }
|
|
@@ -151,7 +151,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
151
151
|
} catch (error$1) {
|
|
152
152
|
throw new error.MastraError(
|
|
153
153
|
{
|
|
154
|
-
id: "
|
|
154
|
+
id: storage.createStorageErrorId("LANCE", "GET_THREAD_BY_ID", "FAILED"),
|
|
155
155
|
domain: error.ErrorDomain.STORAGE,
|
|
156
156
|
category: error.ErrorCategory.THIRD_PARTY
|
|
157
157
|
},
|
|
@@ -173,7 +173,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
173
173
|
} catch (error$1) {
|
|
174
174
|
throw new error.MastraError(
|
|
175
175
|
{
|
|
176
|
-
id: "
|
|
176
|
+
id: storage.createStorageErrorId("LANCE", "SAVE_THREAD", "FAILED"),
|
|
177
177
|
domain: error.ErrorDomain.STORAGE,
|
|
178
178
|
category: error.ErrorCategory.THIRD_PARTY
|
|
179
179
|
},
|
|
@@ -215,7 +215,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
215
215
|
}
|
|
216
216
|
throw new error.MastraError(
|
|
217
217
|
{
|
|
218
|
-
id: "
|
|
218
|
+
id: storage.createStorageErrorId("LANCE", "UPDATE_THREAD", "FAILED"),
|
|
219
219
|
domain: error.ErrorDomain.STORAGE,
|
|
220
220
|
category: error.ErrorCategory.THIRD_PARTY
|
|
221
221
|
},
|
|
@@ -225,7 +225,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
225
225
|
}
|
|
226
226
|
throw new error.MastraError(
|
|
227
227
|
{
|
|
228
|
-
id: "
|
|
228
|
+
id: storage.createStorageErrorId("LANCE", "UPDATE_THREAD", "FAILED"),
|
|
229
229
|
domain: error.ErrorDomain.STORAGE,
|
|
230
230
|
category: error.ErrorCategory.THIRD_PARTY
|
|
231
231
|
},
|
|
@@ -241,7 +241,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
241
241
|
} catch (error$1) {
|
|
242
242
|
throw new error.MastraError(
|
|
243
243
|
{
|
|
244
|
-
id: "
|
|
244
|
+
id: storage.createStorageErrorId("LANCE", "DELETE_THREAD", "FAILED"),
|
|
245
245
|
domain: error.ErrorDomain.STORAGE,
|
|
246
246
|
category: error.ErrorCategory.THIRD_PARTY
|
|
247
247
|
},
|
|
@@ -281,7 +281,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
281
281
|
} catch (error$1) {
|
|
282
282
|
throw new error.MastraError(
|
|
283
283
|
{
|
|
284
|
-
id: "
|
|
284
|
+
id: storage.createStorageErrorId("LANCE", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
285
285
|
domain: error.ErrorDomain.STORAGE,
|
|
286
286
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
287
287
|
details: {
|
|
@@ -298,7 +298,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
298
298
|
if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
|
|
299
299
|
throw new error.MastraError(
|
|
300
300
|
{
|
|
301
|
-
id: "
|
|
301
|
+
id: storage.createStorageErrorId("LANCE", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
302
302
|
domain: error.ErrorDomain.STORAGE,
|
|
303
303
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
304
304
|
details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
|
|
@@ -312,7 +312,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
312
312
|
if (page < 0) {
|
|
313
313
|
throw new error.MastraError(
|
|
314
314
|
{
|
|
315
|
-
id: "
|
|
315
|
+
id: storage.createStorageErrorId("LANCE", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
316
316
|
domain: error.ErrorDomain.STORAGE,
|
|
317
317
|
category: error.ErrorCategory.USER,
|
|
318
318
|
details: { page }
|
|
@@ -407,7 +407,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
407
407
|
} catch (error$1) {
|
|
408
408
|
const mastraError = new error.MastraError(
|
|
409
409
|
{
|
|
410
|
-
id: "
|
|
410
|
+
id: storage.createStorageErrorId("LANCE", "LIST_MESSAGES", "FAILED"),
|
|
411
411
|
domain: error.ErrorDomain.STORAGE,
|
|
412
412
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
413
413
|
details: {
|
|
@@ -472,7 +472,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
472
472
|
} catch (error$1) {
|
|
473
473
|
throw new error.MastraError(
|
|
474
474
|
{
|
|
475
|
-
id: "
|
|
475
|
+
id: storage.createStorageErrorId("LANCE", "SAVE_MESSAGES", "FAILED"),
|
|
476
476
|
domain: error.ErrorDomain.STORAGE,
|
|
477
477
|
category: error.ErrorCategory.THIRD_PARTY
|
|
478
478
|
},
|
|
@@ -487,7 +487,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
487
487
|
if (page < 0) {
|
|
488
488
|
throw new error.MastraError(
|
|
489
489
|
{
|
|
490
|
-
id: "
|
|
490
|
+
id: storage.createStorageErrorId("LANCE", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
491
491
|
domain: error.ErrorDomain.STORAGE,
|
|
492
492
|
category: error.ErrorCategory.USER,
|
|
493
493
|
details: { page }
|
|
@@ -527,7 +527,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
527
527
|
} catch (error$1) {
|
|
528
528
|
throw new error.MastraError(
|
|
529
529
|
{
|
|
530
|
-
id: "
|
|
530
|
+
id: storage.createStorageErrorId("LANCE", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
531
531
|
domain: error.ErrorDomain.STORAGE,
|
|
532
532
|
category: error.ErrorCategory.THIRD_PARTY
|
|
533
533
|
},
|
|
@@ -662,7 +662,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
662
662
|
} catch (error$1) {
|
|
663
663
|
throw new error.MastraError(
|
|
664
664
|
{
|
|
665
|
-
id: "
|
|
665
|
+
id: storage.createStorageErrorId("LANCE", "UPDATE_MESSAGES", "FAILED"),
|
|
666
666
|
domain: error.ErrorDomain.STORAGE,
|
|
667
667
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
668
668
|
details: { count: messages.length }
|
|
@@ -739,7 +739,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
739
739
|
} catch (error$1) {
|
|
740
740
|
throw new error.MastraError(
|
|
741
741
|
{
|
|
742
|
-
id: "
|
|
742
|
+
id: storage.createStorageErrorId("LANCE", "GET_RESOURCE_BY_ID", "FAILED"),
|
|
743
743
|
domain: error.ErrorDomain.STORAGE,
|
|
744
744
|
category: error.ErrorCategory.THIRD_PARTY
|
|
745
745
|
},
|
|
@@ -763,7 +763,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
763
763
|
} catch (error$1) {
|
|
764
764
|
throw new error.MastraError(
|
|
765
765
|
{
|
|
766
|
-
id: "
|
|
766
|
+
id: storage.createStorageErrorId("LANCE", "SAVE_RESOURCE", "FAILED"),
|
|
767
767
|
domain: error.ErrorDomain.STORAGE,
|
|
768
768
|
category: error.ErrorCategory.THIRD_PARTY
|
|
769
769
|
},
|
|
@@ -817,7 +817,7 @@ var StoreMemoryLance = class extends storage.MemoryStorage {
|
|
|
817
817
|
}
|
|
818
818
|
throw new error.MastraError(
|
|
819
819
|
{
|
|
820
|
-
id: "
|
|
820
|
+
id: storage.createStorageErrorId("LANCE", "UPDATE_RESOURCE", "FAILED"),
|
|
821
821
|
domain: error.ErrorDomain.STORAGE,
|
|
822
822
|
category: error.ErrorCategory.THIRD_PARTY
|
|
823
823
|
},
|
|
@@ -908,7 +908,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
908
908
|
} catch (error$1) {
|
|
909
909
|
throw new error.MastraError(
|
|
910
910
|
{
|
|
911
|
-
id: "
|
|
911
|
+
id: storage.createStorageErrorId("LANCE", "CREATE_TABLE", "INVALID_ARGS"),
|
|
912
912
|
domain: error.ErrorDomain.STORAGE,
|
|
913
913
|
category: error.ErrorCategory.USER,
|
|
914
914
|
details: { tableName }
|
|
@@ -926,7 +926,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
926
926
|
}
|
|
927
927
|
throw new error.MastraError(
|
|
928
928
|
{
|
|
929
|
-
id: "
|
|
929
|
+
id: storage.createStorageErrorId("LANCE", "CREATE_TABLE", "FAILED"),
|
|
930
930
|
domain: error.ErrorDomain.STORAGE,
|
|
931
931
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
932
932
|
details: { tableName }
|
|
@@ -946,7 +946,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
946
946
|
} catch (validationError) {
|
|
947
947
|
throw new error.MastraError(
|
|
948
948
|
{
|
|
949
|
-
id: "
|
|
949
|
+
id: storage.createStorageErrorId("LANCE", "DROP_TABLE", "INVALID_ARGS"),
|
|
950
950
|
domain: error.ErrorDomain.STORAGE,
|
|
951
951
|
category: error.ErrorCategory.USER,
|
|
952
952
|
text: validationError.message,
|
|
@@ -964,7 +964,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
964
964
|
}
|
|
965
965
|
throw new error.MastraError(
|
|
966
966
|
{
|
|
967
|
-
id: "
|
|
967
|
+
id: storage.createStorageErrorId("LANCE", "DROP_TABLE", "FAILED"),
|
|
968
968
|
domain: error.ErrorDomain.STORAGE,
|
|
969
969
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
970
970
|
details: { tableName }
|
|
@@ -995,7 +995,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
995
995
|
} catch (validationError) {
|
|
996
996
|
throw new error.MastraError(
|
|
997
997
|
{
|
|
998
|
-
id: "
|
|
998
|
+
id: storage.createStorageErrorId("LANCE", "ALTER_TABLE", "INVALID_ARGS"),
|
|
999
999
|
domain: error.ErrorDomain.STORAGE,
|
|
1000
1000
|
category: error.ErrorCategory.USER,
|
|
1001
1001
|
text: validationError.message,
|
|
@@ -1030,7 +1030,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1030
1030
|
} catch (error$1) {
|
|
1031
1031
|
throw new error.MastraError(
|
|
1032
1032
|
{
|
|
1033
|
-
id: "
|
|
1033
|
+
id: storage.createStorageErrorId("LANCE", "ALTER_TABLE", "FAILED"),
|
|
1034
1034
|
domain: error.ErrorDomain.STORAGE,
|
|
1035
1035
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1036
1036
|
details: { tableName }
|
|
@@ -1050,7 +1050,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1050
1050
|
} catch (validationError) {
|
|
1051
1051
|
throw new error.MastraError(
|
|
1052
1052
|
{
|
|
1053
|
-
id: "
|
|
1053
|
+
id: storage.createStorageErrorId("LANCE", "CLEAR_TABLE", "INVALID_ARGS"),
|
|
1054
1054
|
domain: error.ErrorDomain.STORAGE,
|
|
1055
1055
|
category: error.ErrorCategory.USER,
|
|
1056
1056
|
text: validationError.message,
|
|
@@ -1065,7 +1065,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1065
1065
|
} catch (error$1) {
|
|
1066
1066
|
throw new error.MastraError(
|
|
1067
1067
|
{
|
|
1068
|
-
id: "
|
|
1068
|
+
id: storage.createStorageErrorId("LANCE", "CLEAR_TABLE", "FAILED"),
|
|
1069
1069
|
domain: error.ErrorDomain.STORAGE,
|
|
1070
1070
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1071
1071
|
details: { tableName }
|
|
@@ -1088,7 +1088,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1088
1088
|
} catch (validationError) {
|
|
1089
1089
|
throw new error.MastraError(
|
|
1090
1090
|
{
|
|
1091
|
-
id: "
|
|
1091
|
+
id: storage.createStorageErrorId("LANCE", "INSERT", "INVALID_ARGS"),
|
|
1092
1092
|
domain: error.ErrorDomain.STORAGE,
|
|
1093
1093
|
category: error.ErrorCategory.USER,
|
|
1094
1094
|
text: validationError.message,
|
|
@@ -1107,12 +1107,11 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1107
1107
|
processedRecord[key] = JSON.stringify(processedRecord[key]);
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
|
-
console.info(await table.schema());
|
|
1111
1110
|
await table.mergeInsert(primaryId).whenMatchedUpdateAll().whenNotMatchedInsertAll().execute([processedRecord]);
|
|
1112
1111
|
} catch (error$1) {
|
|
1113
1112
|
throw new error.MastraError(
|
|
1114
1113
|
{
|
|
1115
|
-
id: "
|
|
1114
|
+
id: storage.createStorageErrorId("LANCE", "INSERT", "FAILED"),
|
|
1116
1115
|
domain: error.ErrorDomain.STORAGE,
|
|
1117
1116
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1118
1117
|
details: { tableName }
|
|
@@ -1135,7 +1134,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1135
1134
|
} catch (validationError) {
|
|
1136
1135
|
throw new error.MastraError(
|
|
1137
1136
|
{
|
|
1138
|
-
id: "
|
|
1137
|
+
id: storage.createStorageErrorId("LANCE", "BATCH_INSERT", "INVALID_ARGS"),
|
|
1139
1138
|
domain: error.ErrorDomain.STORAGE,
|
|
1140
1139
|
category: error.ErrorCategory.USER,
|
|
1141
1140
|
text: validationError.message,
|
|
@@ -1161,7 +1160,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1161
1160
|
} catch (error$1) {
|
|
1162
1161
|
throw new error.MastraError(
|
|
1163
1162
|
{
|
|
1164
|
-
id: "
|
|
1163
|
+
id: storage.createStorageErrorId("LANCE", "BATCH_INSERT", "FAILED"),
|
|
1165
1164
|
domain: error.ErrorDomain.STORAGE,
|
|
1166
1165
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1167
1166
|
details: { tableName }
|
|
@@ -1184,7 +1183,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1184
1183
|
} catch (validationError) {
|
|
1185
1184
|
throw new error.MastraError(
|
|
1186
1185
|
{
|
|
1187
|
-
id: "
|
|
1186
|
+
id: storage.createStorageErrorId("LANCE", "LOAD", "INVALID_ARGS"),
|
|
1188
1187
|
domain: error.ErrorDomain.STORAGE,
|
|
1189
1188
|
category: error.ErrorCategory.USER,
|
|
1190
1189
|
text: validationError.message,
|
|
@@ -1223,7 +1222,7 @@ var StoreOperationsLance = class extends storage.StoreOperations {
|
|
|
1223
1222
|
if (error$1 instanceof error.MastraError) throw error$1;
|
|
1224
1223
|
throw new error.MastraError(
|
|
1225
1224
|
{
|
|
1226
|
-
id: "
|
|
1225
|
+
id: storage.createStorageErrorId("LANCE", "LOAD", "FAILED"),
|
|
1227
1226
|
domain: error.ErrorDomain.STORAGE,
|
|
1228
1227
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1229
1228
|
details: { tableName, keyCount: Object.keys(keys).length, firstKey: Object.keys(keys)[0] ?? "" }
|
|
@@ -1246,7 +1245,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1246
1245
|
} catch (error$1) {
|
|
1247
1246
|
throw new error.MastraError(
|
|
1248
1247
|
{
|
|
1249
|
-
id: "
|
|
1248
|
+
id: storage.createStorageErrorId("LANCE", "SAVE_SCORE", "INVALID_PAYLOAD"),
|
|
1250
1249
|
text: "Failed to save score in LanceStorage",
|
|
1251
1250
|
domain: error.ErrorDomain.STORAGE,
|
|
1252
1251
|
category: error.ErrorCategory.THIRD_PARTY
|
|
@@ -1278,7 +1277,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1278
1277
|
} catch (error$1) {
|
|
1279
1278
|
throw new error.MastraError(
|
|
1280
1279
|
{
|
|
1281
|
-
id: "
|
|
1280
|
+
id: storage.createStorageErrorId("LANCE", "SAVE_SCORE", "FAILED"),
|
|
1282
1281
|
text: "Failed to save score in LanceStorage",
|
|
1283
1282
|
domain: error.ErrorDomain.STORAGE,
|
|
1284
1283
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1298,7 +1297,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1298
1297
|
} catch (error$1) {
|
|
1299
1298
|
throw new error.MastraError(
|
|
1300
1299
|
{
|
|
1301
|
-
id: "
|
|
1300
|
+
id: storage.createStorageErrorId("LANCE", "GET_SCORE_BY_ID", "FAILED"),
|
|
1302
1301
|
text: "Failed to get score by id in LanceStorage",
|
|
1303
1302
|
domain: error.ErrorDomain.STORAGE,
|
|
1304
1303
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1377,7 +1376,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1377
1376
|
} catch (error$1) {
|
|
1378
1377
|
throw new error.MastraError(
|
|
1379
1378
|
{
|
|
1380
|
-
id: "
|
|
1379
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
1381
1380
|
text: "Failed to get scores by scorerId in LanceStorage",
|
|
1382
1381
|
domain: error.ErrorDomain.STORAGE,
|
|
1383
1382
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1418,7 +1417,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1418
1417
|
} catch (error$1) {
|
|
1419
1418
|
throw new error.MastraError(
|
|
1420
1419
|
{
|
|
1421
|
-
id: "
|
|
1420
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
1422
1421
|
text: "Failed to get scores by runId in LanceStorage",
|
|
1423
1422
|
domain: error.ErrorDomain.STORAGE,
|
|
1424
1423
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1460,7 +1459,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1460
1459
|
} catch (error$1) {
|
|
1461
1460
|
throw new error.MastraError(
|
|
1462
1461
|
{
|
|
1463
|
-
id: "
|
|
1462
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
1464
1463
|
text: "Failed to get scores by entityId and entityType in LanceStorage",
|
|
1465
1464
|
domain: error.ErrorDomain.STORAGE,
|
|
1466
1465
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1502,7 +1501,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1502
1501
|
} catch (error$1) {
|
|
1503
1502
|
throw new error.MastraError(
|
|
1504
1503
|
{
|
|
1505
|
-
id: "
|
|
1504
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
1506
1505
|
text: "Failed to get scores by traceId and spanId in LanceStorage",
|
|
1507
1506
|
domain: error.ErrorDomain.STORAGE,
|
|
1508
1507
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1584,7 +1583,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1584
1583
|
} catch (error$1) {
|
|
1585
1584
|
throw new error.MastraError(
|
|
1586
1585
|
{
|
|
1587
|
-
id: "
|
|
1586
|
+
id: storage.createStorageErrorId("LANCE", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1588
1587
|
domain: error.ErrorDomain.STORAGE,
|
|
1589
1588
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1590
1589
|
details: { workflowName, runId }
|
|
@@ -1605,7 +1604,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1605
1604
|
} catch (error$1) {
|
|
1606
1605
|
throw new error.MastraError(
|
|
1607
1606
|
{
|
|
1608
|
-
id: "
|
|
1607
|
+
id: storage.createStorageErrorId("LANCE", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1609
1608
|
domain: error.ErrorDomain.STORAGE,
|
|
1610
1609
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1611
1610
|
details: { workflowName, runId }
|
|
@@ -1629,7 +1628,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1629
1628
|
} catch (error$1) {
|
|
1630
1629
|
throw new error.MastraError(
|
|
1631
1630
|
{
|
|
1632
|
-
id: "
|
|
1631
|
+
id: storage.createStorageErrorId("LANCE", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
1633
1632
|
domain: error.ErrorDomain.STORAGE,
|
|
1634
1633
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1635
1634
|
details: { runId: args.runId, workflowName: args.workflowName ?? "" }
|
|
@@ -1671,7 +1670,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1671
1670
|
if (args.page < 0 || !Number.isInteger(args.page)) {
|
|
1672
1671
|
throw new error.MastraError(
|
|
1673
1672
|
{
|
|
1674
|
-
id: "
|
|
1673
|
+
id: storage.createStorageErrorId("LANCE", "LIST_WORKFLOW_RUNS", "INVALID_PAGINATION"),
|
|
1675
1674
|
domain: error.ErrorDomain.STORAGE,
|
|
1676
1675
|
category: error.ErrorCategory.USER,
|
|
1677
1676
|
details: { page: args.page, perPage: args.perPage }
|
|
@@ -1691,7 +1690,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1691
1690
|
} catch (error$1) {
|
|
1692
1691
|
throw new error.MastraError(
|
|
1693
1692
|
{
|
|
1694
|
-
id: "
|
|
1693
|
+
id: storage.createStorageErrorId("LANCE", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
1695
1694
|
domain: error.ErrorDomain.STORAGE,
|
|
1696
1695
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1697
1696
|
details: { resourceId: args?.resourceId ?? "", workflowName: args?.workflowName ?? "" }
|
|
@@ -1711,7 +1710,8 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1711
1710
|
* @param id The unique identifier for this storage instance
|
|
1712
1711
|
* @param name The name for this storage instance
|
|
1713
1712
|
* @param uri The URI to connect to LanceDB
|
|
1714
|
-
* @param
|
|
1713
|
+
* @param connectionOptions connection options for LanceDB
|
|
1714
|
+
* @param storageOptions storage options including disableInit
|
|
1715
1715
|
*
|
|
1716
1716
|
* Usage:
|
|
1717
1717
|
*
|
|
@@ -1729,11 +1729,16 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1729
1729
|
* ```ts
|
|
1730
1730
|
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 's3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
1731
1731
|
* ```
|
|
1732
|
+
*
|
|
1733
|
+
* Disable auto-init for runtime (after CI/CD has run migrations)
|
|
1734
|
+
* ```ts
|
|
1735
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db', undefined, { disableInit: true });
|
|
1736
|
+
* ```
|
|
1732
1737
|
*/
|
|
1733
|
-
static async create(id, name, uri,
|
|
1734
|
-
const instance = new _LanceStorage(id, name);
|
|
1738
|
+
static async create(id, name, uri, connectionOptions, storageOptions) {
|
|
1739
|
+
const instance = new _LanceStorage(id, name, storageOptions?.disableInit);
|
|
1735
1740
|
try {
|
|
1736
|
-
instance.lanceClient = await lancedb.connect(uri,
|
|
1741
|
+
instance.lanceClient = await lancedb.connect(uri, connectionOptions);
|
|
1737
1742
|
const operations = new StoreOperationsLance({ client: instance.lanceClient });
|
|
1738
1743
|
instance.stores = {
|
|
1739
1744
|
operations: new StoreOperationsLance({ client: instance.lanceClient }),
|
|
@@ -1745,11 +1750,11 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1745
1750
|
} catch (e) {
|
|
1746
1751
|
throw new error.MastraError(
|
|
1747
1752
|
{
|
|
1748
|
-
id: "
|
|
1753
|
+
id: storage.createStorageErrorId("LANCE", "CONNECT", "FAILED"),
|
|
1749
1754
|
domain: error.ErrorDomain.STORAGE,
|
|
1750
1755
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1751
1756
|
text: `Failed to connect to LanceDB: ${e.message || e}`,
|
|
1752
|
-
details: { uri, optionsProvided: !!
|
|
1757
|
+
details: { uri, optionsProvided: !!connectionOptions }
|
|
1753
1758
|
},
|
|
1754
1759
|
e
|
|
1755
1760
|
);
|
|
@@ -1759,8 +1764,8 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1759
1764
|
* @internal
|
|
1760
1765
|
* Private constructor to enforce using the create factory method
|
|
1761
1766
|
*/
|
|
1762
|
-
constructor(id, name) {
|
|
1763
|
-
super({ id, name });
|
|
1767
|
+
constructor(id, name, disableInit) {
|
|
1768
|
+
super({ id, name, disableInit });
|
|
1764
1769
|
const operations = new StoreOperationsLance({ client: this.lanceClient });
|
|
1765
1770
|
this.stores = {
|
|
1766
1771
|
operations: new StoreOperationsLance({ client: this.lanceClient }),
|
|
@@ -2323,7 +2328,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2323
2328
|
} catch (e) {
|
|
2324
2329
|
throw new error.MastraError(
|
|
2325
2330
|
{
|
|
2326
|
-
id: "
|
|
2331
|
+
id: storage.createVectorErrorId("LANCE", "CONNECT", "FAILED"),
|
|
2327
2332
|
domain: error.ErrorDomain.STORAGE,
|
|
2328
2333
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2329
2334
|
details: { uri }
|
|
@@ -2366,7 +2371,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2366
2371
|
} catch (error$1) {
|
|
2367
2372
|
throw new error.MastraError(
|
|
2368
2373
|
{
|
|
2369
|
-
id: "
|
|
2374
|
+
id: storage.createVectorErrorId("LANCE", "QUERY", "INVALID_ARGS"),
|
|
2370
2375
|
domain: error.ErrorDomain.STORAGE,
|
|
2371
2376
|
category: error.ErrorCategory.USER,
|
|
2372
2377
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2414,7 +2419,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2414
2419
|
} catch (error$1) {
|
|
2415
2420
|
throw new error.MastraError(
|
|
2416
2421
|
{
|
|
2417
|
-
id: "
|
|
2422
|
+
id: storage.createVectorErrorId("LANCE", "QUERY", "FAILED"),
|
|
2418
2423
|
domain: error.ErrorDomain.STORAGE,
|
|
2419
2424
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2420
2425
|
details: { tableName, includeVector, columnsCount: columns?.length, includeAllColumns }
|
|
@@ -2466,7 +2471,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2466
2471
|
} catch (error$1) {
|
|
2467
2472
|
throw new error.MastraError(
|
|
2468
2473
|
{
|
|
2469
|
-
id: "
|
|
2474
|
+
id: storage.createVectorErrorId("LANCE", "UPSERT", "INVALID_ARGS"),
|
|
2470
2475
|
domain: error.ErrorDomain.STORAGE,
|
|
2471
2476
|
category: error.ErrorCategory.USER,
|
|
2472
2477
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2502,7 +2507,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2502
2507
|
} catch (error$1) {
|
|
2503
2508
|
throw new error.MastraError(
|
|
2504
2509
|
{
|
|
2505
|
-
id: "
|
|
2510
|
+
id: storage.createVectorErrorId("LANCE", "UPSERT", "FAILED"),
|
|
2506
2511
|
domain: error.ErrorDomain.STORAGE,
|
|
2507
2512
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2508
2513
|
details: { tableName, vectorCount: vectors.length, metadataCount: metadata.length, idsCount: ids.length }
|
|
@@ -2529,7 +2534,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2529
2534
|
async createTable(tableName, data, options) {
|
|
2530
2535
|
if (!this.lanceClient) {
|
|
2531
2536
|
throw new error.MastraError({
|
|
2532
|
-
id: "
|
|
2537
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_TABLE", "INVALID_ARGS"),
|
|
2533
2538
|
domain: error.ErrorDomain.STORAGE,
|
|
2534
2539
|
category: error.ErrorCategory.USER,
|
|
2535
2540
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2544,7 +2549,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2544
2549
|
} catch (error$1) {
|
|
2545
2550
|
throw new error.MastraError(
|
|
2546
2551
|
{
|
|
2547
|
-
id: "
|
|
2552
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_TABLE", "FAILED"),
|
|
2548
2553
|
domain: error.ErrorDomain.STORAGE,
|
|
2549
2554
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2550
2555
|
details: { tableName }
|
|
@@ -2556,7 +2561,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2556
2561
|
async listTables() {
|
|
2557
2562
|
if (!this.lanceClient) {
|
|
2558
2563
|
throw new error.MastraError({
|
|
2559
|
-
id: "
|
|
2564
|
+
id: storage.createVectorErrorId("LANCE", "LIST_TABLES", "INVALID_ARGS"),
|
|
2560
2565
|
domain: error.ErrorDomain.STORAGE,
|
|
2561
2566
|
category: error.ErrorCategory.USER,
|
|
2562
2567
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2568,7 +2573,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2568
2573
|
} catch (error$1) {
|
|
2569
2574
|
throw new error.MastraError(
|
|
2570
2575
|
{
|
|
2571
|
-
id: "
|
|
2576
|
+
id: storage.createVectorErrorId("LANCE", "LIST_TABLES", "FAILED"),
|
|
2572
2577
|
domain: error.ErrorDomain.STORAGE,
|
|
2573
2578
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2574
2579
|
},
|
|
@@ -2579,7 +2584,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2579
2584
|
async getTableSchema(tableName) {
|
|
2580
2585
|
if (!this.lanceClient) {
|
|
2581
2586
|
throw new error.MastraError({
|
|
2582
|
-
id: "
|
|
2587
|
+
id: storage.createVectorErrorId("LANCE", "GET_TABLE_SCHEMA", "INVALID_ARGS"),
|
|
2583
2588
|
domain: error.ErrorDomain.STORAGE,
|
|
2584
2589
|
category: error.ErrorCategory.USER,
|
|
2585
2590
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2592,7 +2597,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2592
2597
|
} catch (error$1) {
|
|
2593
2598
|
throw new error.MastraError(
|
|
2594
2599
|
{
|
|
2595
|
-
id: "
|
|
2600
|
+
id: storage.createVectorErrorId("LANCE", "GET_TABLE_SCHEMA", "FAILED"),
|
|
2596
2601
|
domain: error.ErrorDomain.STORAGE,
|
|
2597
2602
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2598
2603
|
details: { tableName }
|
|
@@ -2627,7 +2632,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2627
2632
|
} catch (err) {
|
|
2628
2633
|
throw new error.MastraError(
|
|
2629
2634
|
{
|
|
2630
|
-
id: "
|
|
2635
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_INDEX", "INVALID_ARGS"),
|
|
2631
2636
|
domain: error.ErrorDomain.STORAGE,
|
|
2632
2637
|
category: error.ErrorCategory.USER,
|
|
2633
2638
|
details: { tableName: tableName || "", indexName, dimension, metric }
|
|
@@ -2672,7 +2677,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2672
2677
|
} catch (error$1) {
|
|
2673
2678
|
throw new error.MastraError(
|
|
2674
2679
|
{
|
|
2675
|
-
id: "
|
|
2680
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_INDEX", "FAILED"),
|
|
2676
2681
|
domain: error.ErrorDomain.STORAGE,
|
|
2677
2682
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2678
2683
|
details: { tableName: tableName || "", indexName, dimension }
|
|
@@ -2684,7 +2689,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2684
2689
|
async listIndexes() {
|
|
2685
2690
|
if (!this.lanceClient) {
|
|
2686
2691
|
throw new error.MastraError({
|
|
2687
|
-
id: "
|
|
2692
|
+
id: storage.createVectorErrorId("LANCE", "LIST_INDEXES", "INVALID_ARGS"),
|
|
2688
2693
|
domain: error.ErrorDomain.STORAGE,
|
|
2689
2694
|
category: error.ErrorCategory.USER,
|
|
2690
2695
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2703,7 +2708,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2703
2708
|
} catch (error$1) {
|
|
2704
2709
|
throw new error.MastraError(
|
|
2705
2710
|
{
|
|
2706
|
-
id: "
|
|
2711
|
+
id: storage.createVectorErrorId("LANCE", "LIST_INDEXES", "FAILED"),
|
|
2707
2712
|
domain: error.ErrorDomain.STORAGE,
|
|
2708
2713
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2709
2714
|
},
|
|
@@ -2722,7 +2727,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2722
2727
|
} catch (err) {
|
|
2723
2728
|
throw new error.MastraError(
|
|
2724
2729
|
{
|
|
2725
|
-
id: "
|
|
2730
|
+
id: storage.createVectorErrorId("LANCE", "DESCRIBE_INDEX", "INVALID_ARGS"),
|
|
2726
2731
|
domain: error.ErrorDomain.STORAGE,
|
|
2727
2732
|
category: error.ErrorCategory.USER,
|
|
2728
2733
|
details: { indexName }
|
|
@@ -2757,7 +2762,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2757
2762
|
} catch (error$1) {
|
|
2758
2763
|
throw new error.MastraError(
|
|
2759
2764
|
{
|
|
2760
|
-
id: "
|
|
2765
|
+
id: storage.createVectorErrorId("LANCE", "DESCRIBE_INDEX", "FAILED"),
|
|
2761
2766
|
domain: error.ErrorDomain.STORAGE,
|
|
2762
2767
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2763
2768
|
details: { indexName }
|
|
@@ -2777,7 +2782,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2777
2782
|
} catch (err) {
|
|
2778
2783
|
throw new error.MastraError(
|
|
2779
2784
|
{
|
|
2780
|
-
id: "
|
|
2785
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_INDEX", "INVALID_ARGS"),
|
|
2781
2786
|
domain: error.ErrorDomain.STORAGE,
|
|
2782
2787
|
category: error.ErrorCategory.USER,
|
|
2783
2788
|
details: { indexName }
|
|
@@ -2800,7 +2805,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2800
2805
|
} catch (error$1) {
|
|
2801
2806
|
throw new error.MastraError(
|
|
2802
2807
|
{
|
|
2803
|
-
id: "
|
|
2808
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_INDEX", "FAILED"),
|
|
2804
2809
|
domain: error.ErrorDomain.STORAGE,
|
|
2805
2810
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2806
2811
|
details: { indexName }
|
|
@@ -2815,7 +2820,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2815
2820
|
async deleteAllTables() {
|
|
2816
2821
|
if (!this.lanceClient) {
|
|
2817
2822
|
throw new error.MastraError({
|
|
2818
|
-
id: "
|
|
2823
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_ALL_TABLES", "INVALID_ARGS"),
|
|
2819
2824
|
domain: error.ErrorDomain.STORAGE,
|
|
2820
2825
|
category: error.ErrorCategory.USER,
|
|
2821
2826
|
details: { methodName: "deleteAllTables" },
|
|
@@ -2827,7 +2832,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2827
2832
|
} catch (error$1) {
|
|
2828
2833
|
throw new error.MastraError(
|
|
2829
2834
|
{
|
|
2830
|
-
id: "
|
|
2835
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_ALL_TABLES", "FAILED"),
|
|
2831
2836
|
domain: error.ErrorDomain.STORAGE,
|
|
2832
2837
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2833
2838
|
details: { methodName: "deleteAllTables" }
|
|
@@ -2839,7 +2844,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2839
2844
|
async deleteTable(tableName) {
|
|
2840
2845
|
if (!this.lanceClient) {
|
|
2841
2846
|
throw new error.MastraError({
|
|
2842
|
-
id: "
|
|
2847
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_TABLE", "INVALID_ARGS"),
|
|
2843
2848
|
domain: error.ErrorDomain.STORAGE,
|
|
2844
2849
|
category: error.ErrorCategory.USER,
|
|
2845
2850
|
details: { tableName },
|
|
@@ -2851,7 +2856,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2851
2856
|
} catch (error$1) {
|
|
2852
2857
|
throw new error.MastraError(
|
|
2853
2858
|
{
|
|
2854
|
-
id: "
|
|
2859
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_TABLE", "FAILED"),
|
|
2855
2860
|
domain: error.ErrorDomain.STORAGE,
|
|
2856
2861
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2857
2862
|
details: { tableName }
|
|
@@ -2864,7 +2869,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2864
2869
|
const { indexName, update } = params;
|
|
2865
2870
|
if ("id" in params && "filter" in params && params.id && params.filter) {
|
|
2866
2871
|
throw new error.MastraError({
|
|
2867
|
-
id: "
|
|
2872
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "MUTUALLY_EXCLUSIVE"),
|
|
2868
2873
|
domain: error.ErrorDomain.STORAGE,
|
|
2869
2874
|
category: error.ErrorCategory.USER,
|
|
2870
2875
|
text: "id and filter are mutually exclusive",
|
|
@@ -2873,7 +2878,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2873
2878
|
}
|
|
2874
2879
|
if (!("id" in params || "filter" in params) || !params.id && !params.filter) {
|
|
2875
2880
|
throw new error.MastraError({
|
|
2876
|
-
id: "
|
|
2881
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "NO_TARGET"),
|
|
2877
2882
|
domain: error.ErrorDomain.STORAGE,
|
|
2878
2883
|
category: error.ErrorCategory.USER,
|
|
2879
2884
|
text: "Either id or filter must be provided",
|
|
@@ -2882,7 +2887,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2882
2887
|
}
|
|
2883
2888
|
if ("filter" in params && params.filter && Object.keys(params.filter).length === 0) {
|
|
2884
2889
|
throw new error.MastraError({
|
|
2885
|
-
id: "
|
|
2890
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "EMPTY_FILTER"),
|
|
2886
2891
|
domain: error.ErrorDomain.STORAGE,
|
|
2887
2892
|
category: error.ErrorCategory.USER,
|
|
2888
2893
|
text: "Cannot update with empty filter",
|
|
@@ -2891,7 +2896,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2891
2896
|
}
|
|
2892
2897
|
if (!update.vector && !update.metadata) {
|
|
2893
2898
|
throw new error.MastraError({
|
|
2894
|
-
id: "
|
|
2899
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "NO_PAYLOAD"),
|
|
2895
2900
|
domain: error.ErrorDomain.STORAGE,
|
|
2896
2901
|
category: error.ErrorCategory.USER,
|
|
2897
2902
|
text: "No updates provided",
|
|
@@ -2986,7 +2991,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2986
2991
|
if (error$1 instanceof error.MastraError) throw error$1;
|
|
2987
2992
|
throw new error.MastraError(
|
|
2988
2993
|
{
|
|
2989
|
-
id: "
|
|
2994
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "FAILED"),
|
|
2990
2995
|
domain: error.ErrorDomain.STORAGE,
|
|
2991
2996
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2992
2997
|
details: {
|
|
@@ -3015,7 +3020,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3015
3020
|
} catch (err) {
|
|
3016
3021
|
throw new error.MastraError(
|
|
3017
3022
|
{
|
|
3018
|
-
id: "
|
|
3023
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTOR", "INVALID_ARGS"),
|
|
3019
3024
|
domain: error.ErrorDomain.STORAGE,
|
|
3020
3025
|
category: error.ErrorCategory.USER,
|
|
3021
3026
|
details: {
|
|
@@ -3048,7 +3053,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3048
3053
|
} catch (error$1) {
|
|
3049
3054
|
throw new error.MastraError(
|
|
3050
3055
|
{
|
|
3051
|
-
id: "
|
|
3056
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTOR", "FAILED"),
|
|
3052
3057
|
domain: error.ErrorDomain.STORAGE,
|
|
3053
3058
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
3054
3059
|
details: {
|
|
@@ -3088,7 +3093,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3088
3093
|
async deleteVectors({ indexName, filter, ids }) {
|
|
3089
3094
|
if (ids && filter) {
|
|
3090
3095
|
throw new error.MastraError({
|
|
3091
|
-
id: "
|
|
3096
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "MUTUALLY_EXCLUSIVE"),
|
|
3092
3097
|
domain: error.ErrorDomain.STORAGE,
|
|
3093
3098
|
category: error.ErrorCategory.USER,
|
|
3094
3099
|
text: "ids and filter are mutually exclusive",
|
|
@@ -3097,7 +3102,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3097
3102
|
}
|
|
3098
3103
|
if (!ids && !filter) {
|
|
3099
3104
|
throw new error.MastraError({
|
|
3100
|
-
id: "
|
|
3105
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "NO_TARGET"),
|
|
3101
3106
|
domain: error.ErrorDomain.STORAGE,
|
|
3102
3107
|
category: error.ErrorCategory.USER,
|
|
3103
3108
|
text: "Either filter or ids must be provided",
|
|
@@ -3106,7 +3111,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3106
3111
|
}
|
|
3107
3112
|
if (ids && ids.length === 0) {
|
|
3108
3113
|
throw new error.MastraError({
|
|
3109
|
-
id: "
|
|
3114
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "EMPTY_IDS"),
|
|
3110
3115
|
domain: error.ErrorDomain.STORAGE,
|
|
3111
3116
|
category: error.ErrorCategory.USER,
|
|
3112
3117
|
text: "Cannot delete with empty ids array",
|
|
@@ -3115,7 +3120,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3115
3120
|
}
|
|
3116
3121
|
if (filter && Object.keys(filter).length === 0) {
|
|
3117
3122
|
throw new error.MastraError({
|
|
3118
|
-
id: "
|
|
3123
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "EMPTY_FILTER"),
|
|
3119
3124
|
domain: error.ErrorDomain.STORAGE,
|
|
3120
3125
|
category: error.ErrorCategory.USER,
|
|
3121
3126
|
text: "Cannot delete with empty filter",
|
|
@@ -3175,7 +3180,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3175
3180
|
if (error$1 instanceof error.MastraError) throw error$1;
|
|
3176
3181
|
throw new error.MastraError(
|
|
3177
3182
|
{
|
|
3178
|
-
id: "
|
|
3183
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "FAILED"),
|
|
3179
3184
|
domain: error.ErrorDomain.STORAGE,
|
|
3180
3185
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
3181
3186
|
details: {
|