@mastra/lance 1.0.0-beta.3 → 1.0.0-beta.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/CHANGELOG.md +47 -0
- package/dist/index.cjs +111 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +112 -99
- 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 +2 -2
- 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 +32 -4
- 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,39 +1245,47 @@ 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", "VALIDATION_FAILED"),
|
|
1250
1249
|
text: "Failed to save score in LanceStorage",
|
|
1251
1250
|
domain: error.ErrorDomain.STORAGE,
|
|
1252
|
-
category: error.ErrorCategory.
|
|
1251
|
+
category: error.ErrorCategory.USER,
|
|
1252
|
+
details: {
|
|
1253
|
+
scorer: score.scorer?.id ?? "unknown",
|
|
1254
|
+
entityId: score.entityId ?? "unknown",
|
|
1255
|
+
entityType: score.entityType ?? "unknown",
|
|
1256
|
+
traceId: score.traceId ?? "",
|
|
1257
|
+
spanId: score.spanId ?? ""
|
|
1258
|
+
}
|
|
1253
1259
|
},
|
|
1254
1260
|
error$1
|
|
1255
1261
|
);
|
|
1256
1262
|
}
|
|
1263
|
+
const id = crypto.randomUUID();
|
|
1264
|
+
const now = /* @__PURE__ */ new Date();
|
|
1257
1265
|
try {
|
|
1258
|
-
const id = crypto.randomUUID();
|
|
1259
1266
|
const table = await this.client.openTable(storage.TABLE_SCORERS);
|
|
1260
1267
|
const schema = await getTableSchema({ tableName: storage.TABLE_SCORERS, client: this.client });
|
|
1261
1268
|
const allowedFields = new Set(schema.fields.map((f) => f.name));
|
|
1262
1269
|
const filteredScore = {};
|
|
1263
|
-
Object.keys(validatedScore)
|
|
1270
|
+
for (const key of Object.keys(validatedScore)) {
|
|
1264
1271
|
if (allowedFields.has(key)) {
|
|
1265
|
-
filteredScore[key] =
|
|
1272
|
+
filteredScore[key] = validatedScore[key];
|
|
1266
1273
|
}
|
|
1267
|
-
}
|
|
1274
|
+
}
|
|
1268
1275
|
for (const key in filteredScore) {
|
|
1269
1276
|
if (filteredScore[key] !== null && typeof filteredScore[key] === "object" && !(filteredScore[key] instanceof Date)) {
|
|
1270
1277
|
filteredScore[key] = JSON.stringify(filteredScore[key]);
|
|
1271
1278
|
}
|
|
1272
1279
|
}
|
|
1273
|
-
filteredScore.createdAt = /* @__PURE__ */ new Date();
|
|
1274
|
-
filteredScore.updatedAt = /* @__PURE__ */ new Date();
|
|
1275
1280
|
filteredScore.id = id;
|
|
1281
|
+
filteredScore.createdAt = now;
|
|
1282
|
+
filteredScore.updatedAt = now;
|
|
1276
1283
|
await table.add([filteredScore], { mode: "append" });
|
|
1277
|
-
return { score };
|
|
1284
|
+
return { score: { ...validatedScore, id, createdAt: now, updatedAt: now } };
|
|
1278
1285
|
} catch (error$1) {
|
|
1279
1286
|
throw new error.MastraError(
|
|
1280
1287
|
{
|
|
1281
|
-
id: "
|
|
1288
|
+
id: storage.createStorageErrorId("LANCE", "SAVE_SCORE", "FAILED"),
|
|
1282
1289
|
text: "Failed to save score in LanceStorage",
|
|
1283
1290
|
domain: error.ErrorDomain.STORAGE,
|
|
1284
1291
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1298,7 +1305,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1298
1305
|
} catch (error$1) {
|
|
1299
1306
|
throw new error.MastraError(
|
|
1300
1307
|
{
|
|
1301
|
-
id: "
|
|
1308
|
+
id: storage.createStorageErrorId("LANCE", "GET_SCORE_BY_ID", "FAILED"),
|
|
1302
1309
|
text: "Failed to get score by id in LanceStorage",
|
|
1303
1310
|
domain: error.ErrorDomain.STORAGE,
|
|
1304
1311
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1377,7 +1384,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1377
1384
|
} catch (error$1) {
|
|
1378
1385
|
throw new error.MastraError(
|
|
1379
1386
|
{
|
|
1380
|
-
id: "
|
|
1387
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
1381
1388
|
text: "Failed to get scores by scorerId in LanceStorage",
|
|
1382
1389
|
domain: error.ErrorDomain.STORAGE,
|
|
1383
1390
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1418,7 +1425,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1418
1425
|
} catch (error$1) {
|
|
1419
1426
|
throw new error.MastraError(
|
|
1420
1427
|
{
|
|
1421
|
-
id: "
|
|
1428
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
1422
1429
|
text: "Failed to get scores by runId in LanceStorage",
|
|
1423
1430
|
domain: error.ErrorDomain.STORAGE,
|
|
1424
1431
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1460,7 +1467,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1460
1467
|
} catch (error$1) {
|
|
1461
1468
|
throw new error.MastraError(
|
|
1462
1469
|
{
|
|
1463
|
-
id: "
|
|
1470
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
1464
1471
|
text: "Failed to get scores by entityId and entityType in LanceStorage",
|
|
1465
1472
|
domain: error.ErrorDomain.STORAGE,
|
|
1466
1473
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1502,7 +1509,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1502
1509
|
} catch (error$1) {
|
|
1503
1510
|
throw new error.MastraError(
|
|
1504
1511
|
{
|
|
1505
|
-
id: "
|
|
1512
|
+
id: storage.createStorageErrorId("LANCE", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
1506
1513
|
text: "Failed to get scores by traceId and spanId in LanceStorage",
|
|
1507
1514
|
domain: error.ErrorDomain.STORAGE,
|
|
1508
1515
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
@@ -1584,7 +1591,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1584
1591
|
} catch (error$1) {
|
|
1585
1592
|
throw new error.MastraError(
|
|
1586
1593
|
{
|
|
1587
|
-
id: "
|
|
1594
|
+
id: storage.createStorageErrorId("LANCE", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1588
1595
|
domain: error.ErrorDomain.STORAGE,
|
|
1589
1596
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1590
1597
|
details: { workflowName, runId }
|
|
@@ -1605,7 +1612,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1605
1612
|
} catch (error$1) {
|
|
1606
1613
|
throw new error.MastraError(
|
|
1607
1614
|
{
|
|
1608
|
-
id: "
|
|
1615
|
+
id: storage.createStorageErrorId("LANCE", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1609
1616
|
domain: error.ErrorDomain.STORAGE,
|
|
1610
1617
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1611
1618
|
details: { workflowName, runId }
|
|
@@ -1629,7 +1636,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1629
1636
|
} catch (error$1) {
|
|
1630
1637
|
throw new error.MastraError(
|
|
1631
1638
|
{
|
|
1632
|
-
id: "
|
|
1639
|
+
id: storage.createStorageErrorId("LANCE", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
1633
1640
|
domain: error.ErrorDomain.STORAGE,
|
|
1634
1641
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1635
1642
|
details: { runId: args.runId, workflowName: args.workflowName ?? "" }
|
|
@@ -1671,7 +1678,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1671
1678
|
if (args.page < 0 || !Number.isInteger(args.page)) {
|
|
1672
1679
|
throw new error.MastraError(
|
|
1673
1680
|
{
|
|
1674
|
-
id: "
|
|
1681
|
+
id: storage.createStorageErrorId("LANCE", "LIST_WORKFLOW_RUNS", "INVALID_PAGINATION"),
|
|
1675
1682
|
domain: error.ErrorDomain.STORAGE,
|
|
1676
1683
|
category: error.ErrorCategory.USER,
|
|
1677
1684
|
details: { page: args.page, perPage: args.perPage }
|
|
@@ -1691,7 +1698,7 @@ var StoreWorkflowsLance = class extends storage.WorkflowsStorage {
|
|
|
1691
1698
|
} catch (error$1) {
|
|
1692
1699
|
throw new error.MastraError(
|
|
1693
1700
|
{
|
|
1694
|
-
id: "
|
|
1701
|
+
id: storage.createStorageErrorId("LANCE", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
1695
1702
|
domain: error.ErrorDomain.STORAGE,
|
|
1696
1703
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1697
1704
|
details: { resourceId: args?.resourceId ?? "", workflowName: args?.workflowName ?? "" }
|
|
@@ -1711,7 +1718,8 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1711
1718
|
* @param id The unique identifier for this storage instance
|
|
1712
1719
|
* @param name The name for this storage instance
|
|
1713
1720
|
* @param uri The URI to connect to LanceDB
|
|
1714
|
-
* @param
|
|
1721
|
+
* @param connectionOptions connection options for LanceDB
|
|
1722
|
+
* @param storageOptions storage options including disableInit
|
|
1715
1723
|
*
|
|
1716
1724
|
* Usage:
|
|
1717
1725
|
*
|
|
@@ -1729,11 +1737,16 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1729
1737
|
* ```ts
|
|
1730
1738
|
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 's3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
1731
1739
|
* ```
|
|
1740
|
+
*
|
|
1741
|
+
* Disable auto-init for runtime (after CI/CD has run migrations)
|
|
1742
|
+
* ```ts
|
|
1743
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db', undefined, { disableInit: true });
|
|
1744
|
+
* ```
|
|
1732
1745
|
*/
|
|
1733
|
-
static async create(id, name, uri,
|
|
1734
|
-
const instance = new _LanceStorage(id, name);
|
|
1746
|
+
static async create(id, name, uri, connectionOptions, storageOptions) {
|
|
1747
|
+
const instance = new _LanceStorage(id, name, storageOptions?.disableInit);
|
|
1735
1748
|
try {
|
|
1736
|
-
instance.lanceClient = await lancedb.connect(uri,
|
|
1749
|
+
instance.lanceClient = await lancedb.connect(uri, connectionOptions);
|
|
1737
1750
|
const operations = new StoreOperationsLance({ client: instance.lanceClient });
|
|
1738
1751
|
instance.stores = {
|
|
1739
1752
|
operations: new StoreOperationsLance({ client: instance.lanceClient }),
|
|
@@ -1745,11 +1758,11 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1745
1758
|
} catch (e) {
|
|
1746
1759
|
throw new error.MastraError(
|
|
1747
1760
|
{
|
|
1748
|
-
id: "
|
|
1761
|
+
id: storage.createStorageErrorId("LANCE", "CONNECT", "FAILED"),
|
|
1749
1762
|
domain: error.ErrorDomain.STORAGE,
|
|
1750
1763
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1751
1764
|
text: `Failed to connect to LanceDB: ${e.message || e}`,
|
|
1752
|
-
details: { uri, optionsProvided: !!
|
|
1765
|
+
details: { uri, optionsProvided: !!connectionOptions }
|
|
1753
1766
|
},
|
|
1754
1767
|
e
|
|
1755
1768
|
);
|
|
@@ -1759,8 +1772,8 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1759
1772
|
* @internal
|
|
1760
1773
|
* Private constructor to enforce using the create factory method
|
|
1761
1774
|
*/
|
|
1762
|
-
constructor(id, name) {
|
|
1763
|
-
super({ id, name });
|
|
1775
|
+
constructor(id, name, disableInit) {
|
|
1776
|
+
super({ id, name, disableInit });
|
|
1764
1777
|
const operations = new StoreOperationsLance({ client: this.lanceClient });
|
|
1765
1778
|
this.stores = {
|
|
1766
1779
|
operations: new StoreOperationsLance({ client: this.lanceClient }),
|
|
@@ -1946,8 +1959,8 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
1946
1959
|
}) {
|
|
1947
1960
|
return this.stores.scores.listScoresByScorerId({ scorerId, source, pagination, entityId, entityType });
|
|
1948
1961
|
}
|
|
1949
|
-
async saveScore(
|
|
1950
|
-
return this.stores.scores.saveScore(
|
|
1962
|
+
async saveScore(score) {
|
|
1963
|
+
return this.stores.scores.saveScore(score);
|
|
1951
1964
|
}
|
|
1952
1965
|
async listScoresByRunId({
|
|
1953
1966
|
runId,
|
|
@@ -2323,7 +2336,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2323
2336
|
} catch (e) {
|
|
2324
2337
|
throw new error.MastraError(
|
|
2325
2338
|
{
|
|
2326
|
-
id: "
|
|
2339
|
+
id: storage.createVectorErrorId("LANCE", "CONNECT", "FAILED"),
|
|
2327
2340
|
domain: error.ErrorDomain.STORAGE,
|
|
2328
2341
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2329
2342
|
details: { uri }
|
|
@@ -2366,7 +2379,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2366
2379
|
} catch (error$1) {
|
|
2367
2380
|
throw new error.MastraError(
|
|
2368
2381
|
{
|
|
2369
|
-
id: "
|
|
2382
|
+
id: storage.createVectorErrorId("LANCE", "QUERY", "INVALID_ARGS"),
|
|
2370
2383
|
domain: error.ErrorDomain.STORAGE,
|
|
2371
2384
|
category: error.ErrorCategory.USER,
|
|
2372
2385
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2414,7 +2427,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2414
2427
|
} catch (error$1) {
|
|
2415
2428
|
throw new error.MastraError(
|
|
2416
2429
|
{
|
|
2417
|
-
id: "
|
|
2430
|
+
id: storage.createVectorErrorId("LANCE", "QUERY", "FAILED"),
|
|
2418
2431
|
domain: error.ErrorDomain.STORAGE,
|
|
2419
2432
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2420
2433
|
details: { tableName, includeVector, columnsCount: columns?.length, includeAllColumns }
|
|
@@ -2466,7 +2479,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2466
2479
|
} catch (error$1) {
|
|
2467
2480
|
throw new error.MastraError(
|
|
2468
2481
|
{
|
|
2469
|
-
id: "
|
|
2482
|
+
id: storage.createVectorErrorId("LANCE", "UPSERT", "INVALID_ARGS"),
|
|
2470
2483
|
domain: error.ErrorDomain.STORAGE,
|
|
2471
2484
|
category: error.ErrorCategory.USER,
|
|
2472
2485
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2502,7 +2515,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2502
2515
|
} catch (error$1) {
|
|
2503
2516
|
throw new error.MastraError(
|
|
2504
2517
|
{
|
|
2505
|
-
id: "
|
|
2518
|
+
id: storage.createVectorErrorId("LANCE", "UPSERT", "FAILED"),
|
|
2506
2519
|
domain: error.ErrorDomain.STORAGE,
|
|
2507
2520
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2508
2521
|
details: { tableName, vectorCount: vectors.length, metadataCount: metadata.length, idsCount: ids.length }
|
|
@@ -2529,7 +2542,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2529
2542
|
async createTable(tableName, data, options) {
|
|
2530
2543
|
if (!this.lanceClient) {
|
|
2531
2544
|
throw new error.MastraError({
|
|
2532
|
-
id: "
|
|
2545
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_TABLE", "INVALID_ARGS"),
|
|
2533
2546
|
domain: error.ErrorDomain.STORAGE,
|
|
2534
2547
|
category: error.ErrorCategory.USER,
|
|
2535
2548
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2544,7 +2557,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2544
2557
|
} catch (error$1) {
|
|
2545
2558
|
throw new error.MastraError(
|
|
2546
2559
|
{
|
|
2547
|
-
id: "
|
|
2560
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_TABLE", "FAILED"),
|
|
2548
2561
|
domain: error.ErrorDomain.STORAGE,
|
|
2549
2562
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2550
2563
|
details: { tableName }
|
|
@@ -2556,7 +2569,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2556
2569
|
async listTables() {
|
|
2557
2570
|
if (!this.lanceClient) {
|
|
2558
2571
|
throw new error.MastraError({
|
|
2559
|
-
id: "
|
|
2572
|
+
id: storage.createVectorErrorId("LANCE", "LIST_TABLES", "INVALID_ARGS"),
|
|
2560
2573
|
domain: error.ErrorDomain.STORAGE,
|
|
2561
2574
|
category: error.ErrorCategory.USER,
|
|
2562
2575
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2568,7 +2581,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2568
2581
|
} catch (error$1) {
|
|
2569
2582
|
throw new error.MastraError(
|
|
2570
2583
|
{
|
|
2571
|
-
id: "
|
|
2584
|
+
id: storage.createVectorErrorId("LANCE", "LIST_TABLES", "FAILED"),
|
|
2572
2585
|
domain: error.ErrorDomain.STORAGE,
|
|
2573
2586
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2574
2587
|
},
|
|
@@ -2579,7 +2592,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2579
2592
|
async getTableSchema(tableName) {
|
|
2580
2593
|
if (!this.lanceClient) {
|
|
2581
2594
|
throw new error.MastraError({
|
|
2582
|
-
id: "
|
|
2595
|
+
id: storage.createVectorErrorId("LANCE", "GET_TABLE_SCHEMA", "INVALID_ARGS"),
|
|
2583
2596
|
domain: error.ErrorDomain.STORAGE,
|
|
2584
2597
|
category: error.ErrorCategory.USER,
|
|
2585
2598
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2592,7 +2605,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2592
2605
|
} catch (error$1) {
|
|
2593
2606
|
throw new error.MastraError(
|
|
2594
2607
|
{
|
|
2595
|
-
id: "
|
|
2608
|
+
id: storage.createVectorErrorId("LANCE", "GET_TABLE_SCHEMA", "FAILED"),
|
|
2596
2609
|
domain: error.ErrorDomain.STORAGE,
|
|
2597
2610
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2598
2611
|
details: { tableName }
|
|
@@ -2627,7 +2640,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2627
2640
|
} catch (err) {
|
|
2628
2641
|
throw new error.MastraError(
|
|
2629
2642
|
{
|
|
2630
|
-
id: "
|
|
2643
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_INDEX", "INVALID_ARGS"),
|
|
2631
2644
|
domain: error.ErrorDomain.STORAGE,
|
|
2632
2645
|
category: error.ErrorCategory.USER,
|
|
2633
2646
|
details: { tableName: tableName || "", indexName, dimension, metric }
|
|
@@ -2672,7 +2685,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2672
2685
|
} catch (error$1) {
|
|
2673
2686
|
throw new error.MastraError(
|
|
2674
2687
|
{
|
|
2675
|
-
id: "
|
|
2688
|
+
id: storage.createVectorErrorId("LANCE", "CREATE_INDEX", "FAILED"),
|
|
2676
2689
|
domain: error.ErrorDomain.STORAGE,
|
|
2677
2690
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2678
2691
|
details: { tableName: tableName || "", indexName, dimension }
|
|
@@ -2684,7 +2697,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2684
2697
|
async listIndexes() {
|
|
2685
2698
|
if (!this.lanceClient) {
|
|
2686
2699
|
throw new error.MastraError({
|
|
2687
|
-
id: "
|
|
2700
|
+
id: storage.createVectorErrorId("LANCE", "LIST_INDEXES", "INVALID_ARGS"),
|
|
2688
2701
|
domain: error.ErrorDomain.STORAGE,
|
|
2689
2702
|
category: error.ErrorCategory.USER,
|
|
2690
2703
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2703,7 +2716,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2703
2716
|
} catch (error$1) {
|
|
2704
2717
|
throw new error.MastraError(
|
|
2705
2718
|
{
|
|
2706
|
-
id: "
|
|
2719
|
+
id: storage.createVectorErrorId("LANCE", "LIST_INDEXES", "FAILED"),
|
|
2707
2720
|
domain: error.ErrorDomain.STORAGE,
|
|
2708
2721
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2709
2722
|
},
|
|
@@ -2722,7 +2735,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2722
2735
|
} catch (err) {
|
|
2723
2736
|
throw new error.MastraError(
|
|
2724
2737
|
{
|
|
2725
|
-
id: "
|
|
2738
|
+
id: storage.createVectorErrorId("LANCE", "DESCRIBE_INDEX", "INVALID_ARGS"),
|
|
2726
2739
|
domain: error.ErrorDomain.STORAGE,
|
|
2727
2740
|
category: error.ErrorCategory.USER,
|
|
2728
2741
|
details: { indexName }
|
|
@@ -2757,7 +2770,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2757
2770
|
} catch (error$1) {
|
|
2758
2771
|
throw new error.MastraError(
|
|
2759
2772
|
{
|
|
2760
|
-
id: "
|
|
2773
|
+
id: storage.createVectorErrorId("LANCE", "DESCRIBE_INDEX", "FAILED"),
|
|
2761
2774
|
domain: error.ErrorDomain.STORAGE,
|
|
2762
2775
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2763
2776
|
details: { indexName }
|
|
@@ -2777,7 +2790,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2777
2790
|
} catch (err) {
|
|
2778
2791
|
throw new error.MastraError(
|
|
2779
2792
|
{
|
|
2780
|
-
id: "
|
|
2793
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_INDEX", "INVALID_ARGS"),
|
|
2781
2794
|
domain: error.ErrorDomain.STORAGE,
|
|
2782
2795
|
category: error.ErrorCategory.USER,
|
|
2783
2796
|
details: { indexName }
|
|
@@ -2800,7 +2813,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2800
2813
|
} catch (error$1) {
|
|
2801
2814
|
throw new error.MastraError(
|
|
2802
2815
|
{
|
|
2803
|
-
id: "
|
|
2816
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_INDEX", "FAILED"),
|
|
2804
2817
|
domain: error.ErrorDomain.STORAGE,
|
|
2805
2818
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2806
2819
|
details: { indexName }
|
|
@@ -2815,7 +2828,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2815
2828
|
async deleteAllTables() {
|
|
2816
2829
|
if (!this.lanceClient) {
|
|
2817
2830
|
throw new error.MastraError({
|
|
2818
|
-
id: "
|
|
2831
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_ALL_TABLES", "INVALID_ARGS"),
|
|
2819
2832
|
domain: error.ErrorDomain.STORAGE,
|
|
2820
2833
|
category: error.ErrorCategory.USER,
|
|
2821
2834
|
details: { methodName: "deleteAllTables" },
|
|
@@ -2827,7 +2840,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2827
2840
|
} catch (error$1) {
|
|
2828
2841
|
throw new error.MastraError(
|
|
2829
2842
|
{
|
|
2830
|
-
id: "
|
|
2843
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_ALL_TABLES", "FAILED"),
|
|
2831
2844
|
domain: error.ErrorDomain.STORAGE,
|
|
2832
2845
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2833
2846
|
details: { methodName: "deleteAllTables" }
|
|
@@ -2839,7 +2852,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2839
2852
|
async deleteTable(tableName) {
|
|
2840
2853
|
if (!this.lanceClient) {
|
|
2841
2854
|
throw new error.MastraError({
|
|
2842
|
-
id: "
|
|
2855
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_TABLE", "INVALID_ARGS"),
|
|
2843
2856
|
domain: error.ErrorDomain.STORAGE,
|
|
2844
2857
|
category: error.ErrorCategory.USER,
|
|
2845
2858
|
details: { tableName },
|
|
@@ -2851,7 +2864,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2851
2864
|
} catch (error$1) {
|
|
2852
2865
|
throw new error.MastraError(
|
|
2853
2866
|
{
|
|
2854
|
-
id: "
|
|
2867
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_TABLE", "FAILED"),
|
|
2855
2868
|
domain: error.ErrorDomain.STORAGE,
|
|
2856
2869
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2857
2870
|
details: { tableName }
|
|
@@ -2864,7 +2877,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2864
2877
|
const { indexName, update } = params;
|
|
2865
2878
|
if ("id" in params && "filter" in params && params.id && params.filter) {
|
|
2866
2879
|
throw new error.MastraError({
|
|
2867
|
-
id: "
|
|
2880
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "MUTUALLY_EXCLUSIVE"),
|
|
2868
2881
|
domain: error.ErrorDomain.STORAGE,
|
|
2869
2882
|
category: error.ErrorCategory.USER,
|
|
2870
2883
|
text: "id and filter are mutually exclusive",
|
|
@@ -2873,7 +2886,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2873
2886
|
}
|
|
2874
2887
|
if (!("id" in params || "filter" in params) || !params.id && !params.filter) {
|
|
2875
2888
|
throw new error.MastraError({
|
|
2876
|
-
id: "
|
|
2889
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "NO_TARGET"),
|
|
2877
2890
|
domain: error.ErrorDomain.STORAGE,
|
|
2878
2891
|
category: error.ErrorCategory.USER,
|
|
2879
2892
|
text: "Either id or filter must be provided",
|
|
@@ -2882,7 +2895,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2882
2895
|
}
|
|
2883
2896
|
if ("filter" in params && params.filter && Object.keys(params.filter).length === 0) {
|
|
2884
2897
|
throw new error.MastraError({
|
|
2885
|
-
id: "
|
|
2898
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "EMPTY_FILTER"),
|
|
2886
2899
|
domain: error.ErrorDomain.STORAGE,
|
|
2887
2900
|
category: error.ErrorCategory.USER,
|
|
2888
2901
|
text: "Cannot update with empty filter",
|
|
@@ -2891,7 +2904,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2891
2904
|
}
|
|
2892
2905
|
if (!update.vector && !update.metadata) {
|
|
2893
2906
|
throw new error.MastraError({
|
|
2894
|
-
id: "
|
|
2907
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "NO_PAYLOAD"),
|
|
2895
2908
|
domain: error.ErrorDomain.STORAGE,
|
|
2896
2909
|
category: error.ErrorCategory.USER,
|
|
2897
2910
|
text: "No updates provided",
|
|
@@ -2986,7 +2999,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
2986
2999
|
if (error$1 instanceof error.MastraError) throw error$1;
|
|
2987
3000
|
throw new error.MastraError(
|
|
2988
3001
|
{
|
|
2989
|
-
id: "
|
|
3002
|
+
id: storage.createVectorErrorId("LANCE", "UPDATE_VECTOR", "FAILED"),
|
|
2990
3003
|
domain: error.ErrorDomain.STORAGE,
|
|
2991
3004
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2992
3005
|
details: {
|
|
@@ -3015,7 +3028,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3015
3028
|
} catch (err) {
|
|
3016
3029
|
throw new error.MastraError(
|
|
3017
3030
|
{
|
|
3018
|
-
id: "
|
|
3031
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTOR", "INVALID_ARGS"),
|
|
3019
3032
|
domain: error.ErrorDomain.STORAGE,
|
|
3020
3033
|
category: error.ErrorCategory.USER,
|
|
3021
3034
|
details: {
|
|
@@ -3048,7 +3061,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3048
3061
|
} catch (error$1) {
|
|
3049
3062
|
throw new error.MastraError(
|
|
3050
3063
|
{
|
|
3051
|
-
id: "
|
|
3064
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTOR", "FAILED"),
|
|
3052
3065
|
domain: error.ErrorDomain.STORAGE,
|
|
3053
3066
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
3054
3067
|
details: {
|
|
@@ -3088,7 +3101,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3088
3101
|
async deleteVectors({ indexName, filter, ids }) {
|
|
3089
3102
|
if (ids && filter) {
|
|
3090
3103
|
throw new error.MastraError({
|
|
3091
|
-
id: "
|
|
3104
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "MUTUALLY_EXCLUSIVE"),
|
|
3092
3105
|
domain: error.ErrorDomain.STORAGE,
|
|
3093
3106
|
category: error.ErrorCategory.USER,
|
|
3094
3107
|
text: "ids and filter are mutually exclusive",
|
|
@@ -3097,7 +3110,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3097
3110
|
}
|
|
3098
3111
|
if (!ids && !filter) {
|
|
3099
3112
|
throw new error.MastraError({
|
|
3100
|
-
id: "
|
|
3113
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "NO_TARGET"),
|
|
3101
3114
|
domain: error.ErrorDomain.STORAGE,
|
|
3102
3115
|
category: error.ErrorCategory.USER,
|
|
3103
3116
|
text: "Either filter or ids must be provided",
|
|
@@ -3106,7 +3119,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3106
3119
|
}
|
|
3107
3120
|
if (ids && ids.length === 0) {
|
|
3108
3121
|
throw new error.MastraError({
|
|
3109
|
-
id: "
|
|
3122
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "EMPTY_IDS"),
|
|
3110
3123
|
domain: error.ErrorDomain.STORAGE,
|
|
3111
3124
|
category: error.ErrorCategory.USER,
|
|
3112
3125
|
text: "Cannot delete with empty ids array",
|
|
@@ -3115,7 +3128,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3115
3128
|
}
|
|
3116
3129
|
if (filter && Object.keys(filter).length === 0) {
|
|
3117
3130
|
throw new error.MastraError({
|
|
3118
|
-
id: "
|
|
3131
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "EMPTY_FILTER"),
|
|
3119
3132
|
domain: error.ErrorDomain.STORAGE,
|
|
3120
3133
|
category: error.ErrorCategory.USER,
|
|
3121
3134
|
text: "Cannot delete with empty filter",
|
|
@@ -3175,7 +3188,7 @@ var LanceVectorStore = class _LanceVectorStore extends vector.MastraVector {
|
|
|
3175
3188
|
if (error$1 instanceof error.MastraError) throw error$1;
|
|
3176
3189
|
throw new error.MastraError(
|
|
3177
3190
|
{
|
|
3178
|
-
id: "
|
|
3191
|
+
id: storage.createVectorErrorId("LANCE", "DELETE_VECTORS", "FAILED"),
|
|
3179
3192
|
domain: error.ErrorDomain.STORAGE,
|
|
3180
3193
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
3181
3194
|
details: {
|