@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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { connect, Index } from '@lancedb/lancedb';
|
|
2
2
|
import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
|
|
3
|
-
import { MastraStorage, StoreOperations, MemoryStorage, TABLE_THREADS, TABLE_MESSAGES, normalizePerPage, calculatePagination, TABLE_RESOURCES, ScoresStorage, TABLE_SCORERS, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, ensureDate } from '@mastra/core/storage';
|
|
3
|
+
import { MastraStorage, createStorageErrorId, createVectorErrorId, StoreOperations, MemoryStorage, TABLE_THREADS, TABLE_MESSAGES, normalizePerPage, calculatePagination, TABLE_RESOURCES, ScoresStorage, TABLE_SCORERS, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, ensureDate } from '@mastra/core/storage';
|
|
4
4
|
import { MessageList } from '@mastra/core/agent';
|
|
5
5
|
import { Utf8, Float64, Binary, Float32, Int32, Field, Schema } from 'apache-arrow';
|
|
6
6
|
import { saveScorePayloadSchema } from '@mastra/core/evals';
|
|
@@ -89,7 +89,7 @@ async function getTableSchema({
|
|
|
89
89
|
} catch (validationError) {
|
|
90
90
|
throw new MastraError(
|
|
91
91
|
{
|
|
92
|
-
id: "
|
|
92
|
+
id: createStorageErrorId("LANCE", "GET_TABLE_SCHEMA", "INVALID_ARGS"),
|
|
93
93
|
domain: ErrorDomain.STORAGE,
|
|
94
94
|
category: ErrorCategory.USER,
|
|
95
95
|
text: validationError.message,
|
|
@@ -112,7 +112,7 @@ async function getTableSchema({
|
|
|
112
112
|
} catch (error) {
|
|
113
113
|
throw new MastraError(
|
|
114
114
|
{
|
|
115
|
-
id: "
|
|
115
|
+
id: createStorageErrorId("LANCE", "GET_TABLE_SCHEMA", "FAILED"),
|
|
116
116
|
domain: ErrorDomain.STORAGE,
|
|
117
117
|
category: ErrorCategory.THIRD_PARTY,
|
|
118
118
|
details: { tableName }
|
|
@@ -149,7 +149,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
149
149
|
} catch (error) {
|
|
150
150
|
throw new MastraError(
|
|
151
151
|
{
|
|
152
|
-
id: "
|
|
152
|
+
id: createStorageErrorId("LANCE", "GET_THREAD_BY_ID", "FAILED"),
|
|
153
153
|
domain: ErrorDomain.STORAGE,
|
|
154
154
|
category: ErrorCategory.THIRD_PARTY
|
|
155
155
|
},
|
|
@@ -171,7 +171,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
171
171
|
} catch (error) {
|
|
172
172
|
throw new MastraError(
|
|
173
173
|
{
|
|
174
|
-
id: "
|
|
174
|
+
id: createStorageErrorId("LANCE", "SAVE_THREAD", "FAILED"),
|
|
175
175
|
domain: ErrorDomain.STORAGE,
|
|
176
176
|
category: ErrorCategory.THIRD_PARTY
|
|
177
177
|
},
|
|
@@ -213,7 +213,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
213
213
|
}
|
|
214
214
|
throw new MastraError(
|
|
215
215
|
{
|
|
216
|
-
id: "
|
|
216
|
+
id: createStorageErrorId("LANCE", "UPDATE_THREAD", "FAILED"),
|
|
217
217
|
domain: ErrorDomain.STORAGE,
|
|
218
218
|
category: ErrorCategory.THIRD_PARTY
|
|
219
219
|
},
|
|
@@ -223,7 +223,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
223
223
|
}
|
|
224
224
|
throw new MastraError(
|
|
225
225
|
{
|
|
226
|
-
id: "
|
|
226
|
+
id: createStorageErrorId("LANCE", "UPDATE_THREAD", "FAILED"),
|
|
227
227
|
domain: ErrorDomain.STORAGE,
|
|
228
228
|
category: ErrorCategory.THIRD_PARTY
|
|
229
229
|
},
|
|
@@ -239,7 +239,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
239
239
|
} catch (error) {
|
|
240
240
|
throw new MastraError(
|
|
241
241
|
{
|
|
242
|
-
id: "
|
|
242
|
+
id: createStorageErrorId("LANCE", "DELETE_THREAD", "FAILED"),
|
|
243
243
|
domain: ErrorDomain.STORAGE,
|
|
244
244
|
category: ErrorCategory.THIRD_PARTY
|
|
245
245
|
},
|
|
@@ -279,7 +279,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
279
279
|
} catch (error) {
|
|
280
280
|
throw new MastraError(
|
|
281
281
|
{
|
|
282
|
-
id: "
|
|
282
|
+
id: createStorageErrorId("LANCE", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
283
283
|
domain: ErrorDomain.STORAGE,
|
|
284
284
|
category: ErrorCategory.THIRD_PARTY,
|
|
285
285
|
details: {
|
|
@@ -296,7 +296,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
296
296
|
if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
|
|
297
297
|
throw new MastraError(
|
|
298
298
|
{
|
|
299
|
-
id: "
|
|
299
|
+
id: createStorageErrorId("LANCE", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
300
300
|
domain: ErrorDomain.STORAGE,
|
|
301
301
|
category: ErrorCategory.THIRD_PARTY,
|
|
302
302
|
details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
|
|
@@ -310,7 +310,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
310
310
|
if (page < 0) {
|
|
311
311
|
throw new MastraError(
|
|
312
312
|
{
|
|
313
|
-
id: "
|
|
313
|
+
id: createStorageErrorId("LANCE", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
314
314
|
domain: ErrorDomain.STORAGE,
|
|
315
315
|
category: ErrorCategory.USER,
|
|
316
316
|
details: { page }
|
|
@@ -405,7 +405,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
405
405
|
} catch (error) {
|
|
406
406
|
const mastraError = new MastraError(
|
|
407
407
|
{
|
|
408
|
-
id: "
|
|
408
|
+
id: createStorageErrorId("LANCE", "LIST_MESSAGES", "FAILED"),
|
|
409
409
|
domain: ErrorDomain.STORAGE,
|
|
410
410
|
category: ErrorCategory.THIRD_PARTY,
|
|
411
411
|
details: {
|
|
@@ -470,7 +470,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
470
470
|
} catch (error) {
|
|
471
471
|
throw new MastraError(
|
|
472
472
|
{
|
|
473
|
-
id: "
|
|
473
|
+
id: createStorageErrorId("LANCE", "SAVE_MESSAGES", "FAILED"),
|
|
474
474
|
domain: ErrorDomain.STORAGE,
|
|
475
475
|
category: ErrorCategory.THIRD_PARTY
|
|
476
476
|
},
|
|
@@ -485,7 +485,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
485
485
|
if (page < 0) {
|
|
486
486
|
throw new MastraError(
|
|
487
487
|
{
|
|
488
|
-
id: "
|
|
488
|
+
id: createStorageErrorId("LANCE", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
489
489
|
domain: ErrorDomain.STORAGE,
|
|
490
490
|
category: ErrorCategory.USER,
|
|
491
491
|
details: { page }
|
|
@@ -525,7 +525,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
525
525
|
} catch (error) {
|
|
526
526
|
throw new MastraError(
|
|
527
527
|
{
|
|
528
|
-
id: "
|
|
528
|
+
id: createStorageErrorId("LANCE", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
529
529
|
domain: ErrorDomain.STORAGE,
|
|
530
530
|
category: ErrorCategory.THIRD_PARTY
|
|
531
531
|
},
|
|
@@ -660,7 +660,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
660
660
|
} catch (error) {
|
|
661
661
|
throw new MastraError(
|
|
662
662
|
{
|
|
663
|
-
id: "
|
|
663
|
+
id: createStorageErrorId("LANCE", "UPDATE_MESSAGES", "FAILED"),
|
|
664
664
|
domain: ErrorDomain.STORAGE,
|
|
665
665
|
category: ErrorCategory.THIRD_PARTY,
|
|
666
666
|
details: { count: messages.length }
|
|
@@ -737,7 +737,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
737
737
|
} catch (error) {
|
|
738
738
|
throw new MastraError(
|
|
739
739
|
{
|
|
740
|
-
id: "
|
|
740
|
+
id: createStorageErrorId("LANCE", "GET_RESOURCE_BY_ID", "FAILED"),
|
|
741
741
|
domain: ErrorDomain.STORAGE,
|
|
742
742
|
category: ErrorCategory.THIRD_PARTY
|
|
743
743
|
},
|
|
@@ -761,7 +761,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
761
761
|
} catch (error) {
|
|
762
762
|
throw new MastraError(
|
|
763
763
|
{
|
|
764
|
-
id: "
|
|
764
|
+
id: createStorageErrorId("LANCE", "SAVE_RESOURCE", "FAILED"),
|
|
765
765
|
domain: ErrorDomain.STORAGE,
|
|
766
766
|
category: ErrorCategory.THIRD_PARTY
|
|
767
767
|
},
|
|
@@ -815,7 +815,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
815
815
|
}
|
|
816
816
|
throw new MastraError(
|
|
817
817
|
{
|
|
818
|
-
id: "
|
|
818
|
+
id: createStorageErrorId("LANCE", "UPDATE_RESOURCE", "FAILED"),
|
|
819
819
|
domain: ErrorDomain.STORAGE,
|
|
820
820
|
category: ErrorCategory.THIRD_PARTY
|
|
821
821
|
},
|
|
@@ -906,7 +906,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
906
906
|
} catch (error) {
|
|
907
907
|
throw new MastraError(
|
|
908
908
|
{
|
|
909
|
-
id: "
|
|
909
|
+
id: createStorageErrorId("LANCE", "CREATE_TABLE", "INVALID_ARGS"),
|
|
910
910
|
domain: ErrorDomain.STORAGE,
|
|
911
911
|
category: ErrorCategory.USER,
|
|
912
912
|
details: { tableName }
|
|
@@ -924,7 +924,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
924
924
|
}
|
|
925
925
|
throw new MastraError(
|
|
926
926
|
{
|
|
927
|
-
id: "
|
|
927
|
+
id: createStorageErrorId("LANCE", "CREATE_TABLE", "FAILED"),
|
|
928
928
|
domain: ErrorDomain.STORAGE,
|
|
929
929
|
category: ErrorCategory.THIRD_PARTY,
|
|
930
930
|
details: { tableName }
|
|
@@ -944,7 +944,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
944
944
|
} catch (validationError) {
|
|
945
945
|
throw new MastraError(
|
|
946
946
|
{
|
|
947
|
-
id: "
|
|
947
|
+
id: createStorageErrorId("LANCE", "DROP_TABLE", "INVALID_ARGS"),
|
|
948
948
|
domain: ErrorDomain.STORAGE,
|
|
949
949
|
category: ErrorCategory.USER,
|
|
950
950
|
text: validationError.message,
|
|
@@ -962,7 +962,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
962
962
|
}
|
|
963
963
|
throw new MastraError(
|
|
964
964
|
{
|
|
965
|
-
id: "
|
|
965
|
+
id: createStorageErrorId("LANCE", "DROP_TABLE", "FAILED"),
|
|
966
966
|
domain: ErrorDomain.STORAGE,
|
|
967
967
|
category: ErrorCategory.THIRD_PARTY,
|
|
968
968
|
details: { tableName }
|
|
@@ -993,7 +993,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
993
993
|
} catch (validationError) {
|
|
994
994
|
throw new MastraError(
|
|
995
995
|
{
|
|
996
|
-
id: "
|
|
996
|
+
id: createStorageErrorId("LANCE", "ALTER_TABLE", "INVALID_ARGS"),
|
|
997
997
|
domain: ErrorDomain.STORAGE,
|
|
998
998
|
category: ErrorCategory.USER,
|
|
999
999
|
text: validationError.message,
|
|
@@ -1028,7 +1028,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1028
1028
|
} catch (error) {
|
|
1029
1029
|
throw new MastraError(
|
|
1030
1030
|
{
|
|
1031
|
-
id: "
|
|
1031
|
+
id: createStorageErrorId("LANCE", "ALTER_TABLE", "FAILED"),
|
|
1032
1032
|
domain: ErrorDomain.STORAGE,
|
|
1033
1033
|
category: ErrorCategory.THIRD_PARTY,
|
|
1034
1034
|
details: { tableName }
|
|
@@ -1048,7 +1048,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1048
1048
|
} catch (validationError) {
|
|
1049
1049
|
throw new MastraError(
|
|
1050
1050
|
{
|
|
1051
|
-
id: "
|
|
1051
|
+
id: createStorageErrorId("LANCE", "CLEAR_TABLE", "INVALID_ARGS"),
|
|
1052
1052
|
domain: ErrorDomain.STORAGE,
|
|
1053
1053
|
category: ErrorCategory.USER,
|
|
1054
1054
|
text: validationError.message,
|
|
@@ -1063,7 +1063,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1063
1063
|
} catch (error) {
|
|
1064
1064
|
throw new MastraError(
|
|
1065
1065
|
{
|
|
1066
|
-
id: "
|
|
1066
|
+
id: createStorageErrorId("LANCE", "CLEAR_TABLE", "FAILED"),
|
|
1067
1067
|
domain: ErrorDomain.STORAGE,
|
|
1068
1068
|
category: ErrorCategory.THIRD_PARTY,
|
|
1069
1069
|
details: { tableName }
|
|
@@ -1086,7 +1086,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1086
1086
|
} catch (validationError) {
|
|
1087
1087
|
throw new MastraError(
|
|
1088
1088
|
{
|
|
1089
|
-
id: "
|
|
1089
|
+
id: createStorageErrorId("LANCE", "INSERT", "INVALID_ARGS"),
|
|
1090
1090
|
domain: ErrorDomain.STORAGE,
|
|
1091
1091
|
category: ErrorCategory.USER,
|
|
1092
1092
|
text: validationError.message,
|
|
@@ -1105,12 +1105,11 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1105
1105
|
processedRecord[key] = JSON.stringify(processedRecord[key]);
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
console.info(await table.schema());
|
|
1109
1108
|
await table.mergeInsert(primaryId).whenMatchedUpdateAll().whenNotMatchedInsertAll().execute([processedRecord]);
|
|
1110
1109
|
} catch (error) {
|
|
1111
1110
|
throw new MastraError(
|
|
1112
1111
|
{
|
|
1113
|
-
id: "
|
|
1112
|
+
id: createStorageErrorId("LANCE", "INSERT", "FAILED"),
|
|
1114
1113
|
domain: ErrorDomain.STORAGE,
|
|
1115
1114
|
category: ErrorCategory.THIRD_PARTY,
|
|
1116
1115
|
details: { tableName }
|
|
@@ -1133,7 +1132,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1133
1132
|
} catch (validationError) {
|
|
1134
1133
|
throw new MastraError(
|
|
1135
1134
|
{
|
|
1136
|
-
id: "
|
|
1135
|
+
id: createStorageErrorId("LANCE", "BATCH_INSERT", "INVALID_ARGS"),
|
|
1137
1136
|
domain: ErrorDomain.STORAGE,
|
|
1138
1137
|
category: ErrorCategory.USER,
|
|
1139
1138
|
text: validationError.message,
|
|
@@ -1159,7 +1158,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1159
1158
|
} catch (error) {
|
|
1160
1159
|
throw new MastraError(
|
|
1161
1160
|
{
|
|
1162
|
-
id: "
|
|
1161
|
+
id: createStorageErrorId("LANCE", "BATCH_INSERT", "FAILED"),
|
|
1163
1162
|
domain: ErrorDomain.STORAGE,
|
|
1164
1163
|
category: ErrorCategory.THIRD_PARTY,
|
|
1165
1164
|
details: { tableName }
|
|
@@ -1182,7 +1181,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1182
1181
|
} catch (validationError) {
|
|
1183
1182
|
throw new MastraError(
|
|
1184
1183
|
{
|
|
1185
|
-
id: "
|
|
1184
|
+
id: createStorageErrorId("LANCE", "LOAD", "INVALID_ARGS"),
|
|
1186
1185
|
domain: ErrorDomain.STORAGE,
|
|
1187
1186
|
category: ErrorCategory.USER,
|
|
1188
1187
|
text: validationError.message,
|
|
@@ -1221,7 +1220,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1221
1220
|
if (error instanceof MastraError) throw error;
|
|
1222
1221
|
throw new MastraError(
|
|
1223
1222
|
{
|
|
1224
|
-
id: "
|
|
1223
|
+
id: createStorageErrorId("LANCE", "LOAD", "FAILED"),
|
|
1225
1224
|
domain: ErrorDomain.STORAGE,
|
|
1226
1225
|
category: ErrorCategory.THIRD_PARTY,
|
|
1227
1226
|
details: { tableName, keyCount: Object.keys(keys).length, firstKey: Object.keys(keys)[0] ?? "" }
|
|
@@ -1244,7 +1243,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1244
1243
|
} catch (error) {
|
|
1245
1244
|
throw new MastraError(
|
|
1246
1245
|
{
|
|
1247
|
-
id: "
|
|
1246
|
+
id: createStorageErrorId("LANCE", "SAVE_SCORE", "INVALID_PAYLOAD"),
|
|
1248
1247
|
text: "Failed to save score in LanceStorage",
|
|
1249
1248
|
domain: ErrorDomain.STORAGE,
|
|
1250
1249
|
category: ErrorCategory.THIRD_PARTY
|
|
@@ -1276,7 +1275,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1276
1275
|
} catch (error) {
|
|
1277
1276
|
throw new MastraError(
|
|
1278
1277
|
{
|
|
1279
|
-
id: "
|
|
1278
|
+
id: createStorageErrorId("LANCE", "SAVE_SCORE", "FAILED"),
|
|
1280
1279
|
text: "Failed to save score in LanceStorage",
|
|
1281
1280
|
domain: ErrorDomain.STORAGE,
|
|
1282
1281
|
category: ErrorCategory.THIRD_PARTY,
|
|
@@ -1296,7 +1295,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1296
1295
|
} catch (error) {
|
|
1297
1296
|
throw new MastraError(
|
|
1298
1297
|
{
|
|
1299
|
-
id: "
|
|
1298
|
+
id: createStorageErrorId("LANCE", "GET_SCORE_BY_ID", "FAILED"),
|
|
1300
1299
|
text: "Failed to get score by id in LanceStorage",
|
|
1301
1300
|
domain: ErrorDomain.STORAGE,
|
|
1302
1301
|
category: ErrorCategory.THIRD_PARTY,
|
|
@@ -1375,7 +1374,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1375
1374
|
} catch (error) {
|
|
1376
1375
|
throw new MastraError(
|
|
1377
1376
|
{
|
|
1378
|
-
id: "
|
|
1377
|
+
id: createStorageErrorId("LANCE", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
1379
1378
|
text: "Failed to get scores by scorerId in LanceStorage",
|
|
1380
1379
|
domain: ErrorDomain.STORAGE,
|
|
1381
1380
|
category: ErrorCategory.THIRD_PARTY,
|
|
@@ -1416,7 +1415,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1416
1415
|
} catch (error) {
|
|
1417
1416
|
throw new MastraError(
|
|
1418
1417
|
{
|
|
1419
|
-
id: "
|
|
1418
|
+
id: createStorageErrorId("LANCE", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
1420
1419
|
text: "Failed to get scores by runId in LanceStorage",
|
|
1421
1420
|
domain: ErrorDomain.STORAGE,
|
|
1422
1421
|
category: ErrorCategory.THIRD_PARTY,
|
|
@@ -1458,7 +1457,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1458
1457
|
} catch (error) {
|
|
1459
1458
|
throw new MastraError(
|
|
1460
1459
|
{
|
|
1461
|
-
id: "
|
|
1460
|
+
id: createStorageErrorId("LANCE", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
1462
1461
|
text: "Failed to get scores by entityId and entityType in LanceStorage",
|
|
1463
1462
|
domain: ErrorDomain.STORAGE,
|
|
1464
1463
|
category: ErrorCategory.THIRD_PARTY,
|
|
@@ -1500,7 +1499,7 @@ var StoreScoresLance = class extends ScoresStorage {
|
|
|
1500
1499
|
} catch (error) {
|
|
1501
1500
|
throw new MastraError(
|
|
1502
1501
|
{
|
|
1503
|
-
id: "
|
|
1502
|
+
id: createStorageErrorId("LANCE", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
1504
1503
|
text: "Failed to get scores by traceId and spanId in LanceStorage",
|
|
1505
1504
|
domain: ErrorDomain.STORAGE,
|
|
1506
1505
|
category: ErrorCategory.THIRD_PARTY,
|
|
@@ -1582,7 +1581,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1582
1581
|
} catch (error) {
|
|
1583
1582
|
throw new MastraError(
|
|
1584
1583
|
{
|
|
1585
|
-
id: "
|
|
1584
|
+
id: createStorageErrorId("LANCE", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1586
1585
|
domain: ErrorDomain.STORAGE,
|
|
1587
1586
|
category: ErrorCategory.THIRD_PARTY,
|
|
1588
1587
|
details: { workflowName, runId }
|
|
@@ -1603,7 +1602,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1603
1602
|
} catch (error) {
|
|
1604
1603
|
throw new MastraError(
|
|
1605
1604
|
{
|
|
1606
|
-
id: "
|
|
1605
|
+
id: createStorageErrorId("LANCE", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1607
1606
|
domain: ErrorDomain.STORAGE,
|
|
1608
1607
|
category: ErrorCategory.THIRD_PARTY,
|
|
1609
1608
|
details: { workflowName, runId }
|
|
@@ -1627,7 +1626,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1627
1626
|
} catch (error) {
|
|
1628
1627
|
throw new MastraError(
|
|
1629
1628
|
{
|
|
1630
|
-
id: "
|
|
1629
|
+
id: createStorageErrorId("LANCE", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
1631
1630
|
domain: ErrorDomain.STORAGE,
|
|
1632
1631
|
category: ErrorCategory.THIRD_PARTY,
|
|
1633
1632
|
details: { runId: args.runId, workflowName: args.workflowName ?? "" }
|
|
@@ -1669,7 +1668,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1669
1668
|
if (args.page < 0 || !Number.isInteger(args.page)) {
|
|
1670
1669
|
throw new MastraError(
|
|
1671
1670
|
{
|
|
1672
|
-
id: "
|
|
1671
|
+
id: createStorageErrorId("LANCE", "LIST_WORKFLOW_RUNS", "INVALID_PAGINATION"),
|
|
1673
1672
|
domain: ErrorDomain.STORAGE,
|
|
1674
1673
|
category: ErrorCategory.USER,
|
|
1675
1674
|
details: { page: args.page, perPage: args.perPage }
|
|
@@ -1689,7 +1688,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1689
1688
|
} catch (error) {
|
|
1690
1689
|
throw new MastraError(
|
|
1691
1690
|
{
|
|
1692
|
-
id: "
|
|
1691
|
+
id: createStorageErrorId("LANCE", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
1693
1692
|
domain: ErrorDomain.STORAGE,
|
|
1694
1693
|
category: ErrorCategory.THIRD_PARTY,
|
|
1695
1694
|
details: { resourceId: args?.resourceId ?? "", workflowName: args?.workflowName ?? "" }
|
|
@@ -1709,7 +1708,8 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1709
1708
|
* @param id The unique identifier for this storage instance
|
|
1710
1709
|
* @param name The name for this storage instance
|
|
1711
1710
|
* @param uri The URI to connect to LanceDB
|
|
1712
|
-
* @param
|
|
1711
|
+
* @param connectionOptions connection options for LanceDB
|
|
1712
|
+
* @param storageOptions storage options including disableInit
|
|
1713
1713
|
*
|
|
1714
1714
|
* Usage:
|
|
1715
1715
|
*
|
|
@@ -1727,11 +1727,16 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1727
1727
|
* ```ts
|
|
1728
1728
|
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 's3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
1729
1729
|
* ```
|
|
1730
|
+
*
|
|
1731
|
+
* Disable auto-init for runtime (after CI/CD has run migrations)
|
|
1732
|
+
* ```ts
|
|
1733
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db', undefined, { disableInit: true });
|
|
1734
|
+
* ```
|
|
1730
1735
|
*/
|
|
1731
|
-
static async create(id, name, uri,
|
|
1732
|
-
const instance = new _LanceStorage(id, name);
|
|
1736
|
+
static async create(id, name, uri, connectionOptions, storageOptions) {
|
|
1737
|
+
const instance = new _LanceStorage(id, name, storageOptions?.disableInit);
|
|
1733
1738
|
try {
|
|
1734
|
-
instance.lanceClient = await connect(uri,
|
|
1739
|
+
instance.lanceClient = await connect(uri, connectionOptions);
|
|
1735
1740
|
const operations = new StoreOperationsLance({ client: instance.lanceClient });
|
|
1736
1741
|
instance.stores = {
|
|
1737
1742
|
operations: new StoreOperationsLance({ client: instance.lanceClient }),
|
|
@@ -1743,11 +1748,11 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1743
1748
|
} catch (e) {
|
|
1744
1749
|
throw new MastraError(
|
|
1745
1750
|
{
|
|
1746
|
-
id: "
|
|
1751
|
+
id: createStorageErrorId("LANCE", "CONNECT", "FAILED"),
|
|
1747
1752
|
domain: ErrorDomain.STORAGE,
|
|
1748
1753
|
category: ErrorCategory.THIRD_PARTY,
|
|
1749
1754
|
text: `Failed to connect to LanceDB: ${e.message || e}`,
|
|
1750
|
-
details: { uri, optionsProvided: !!
|
|
1755
|
+
details: { uri, optionsProvided: !!connectionOptions }
|
|
1751
1756
|
},
|
|
1752
1757
|
e
|
|
1753
1758
|
);
|
|
@@ -1757,8 +1762,8 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1757
1762
|
* @internal
|
|
1758
1763
|
* Private constructor to enforce using the create factory method
|
|
1759
1764
|
*/
|
|
1760
|
-
constructor(id, name) {
|
|
1761
|
-
super({ id, name });
|
|
1765
|
+
constructor(id, name, disableInit) {
|
|
1766
|
+
super({ id, name, disableInit });
|
|
1762
1767
|
const operations = new StoreOperationsLance({ client: this.lanceClient });
|
|
1763
1768
|
this.stores = {
|
|
1764
1769
|
operations: new StoreOperationsLance({ client: this.lanceClient }),
|
|
@@ -2321,7 +2326,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2321
2326
|
} catch (e) {
|
|
2322
2327
|
throw new MastraError(
|
|
2323
2328
|
{
|
|
2324
|
-
id: "
|
|
2329
|
+
id: createVectorErrorId("LANCE", "CONNECT", "FAILED"),
|
|
2325
2330
|
domain: ErrorDomain.STORAGE,
|
|
2326
2331
|
category: ErrorCategory.THIRD_PARTY,
|
|
2327
2332
|
details: { uri }
|
|
@@ -2364,7 +2369,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2364
2369
|
} catch (error) {
|
|
2365
2370
|
throw new MastraError(
|
|
2366
2371
|
{
|
|
2367
|
-
id: "
|
|
2372
|
+
id: createVectorErrorId("LANCE", "QUERY", "INVALID_ARGS"),
|
|
2368
2373
|
domain: ErrorDomain.STORAGE,
|
|
2369
2374
|
category: ErrorCategory.USER,
|
|
2370
2375
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2412,7 +2417,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2412
2417
|
} catch (error) {
|
|
2413
2418
|
throw new MastraError(
|
|
2414
2419
|
{
|
|
2415
|
-
id: "
|
|
2420
|
+
id: createVectorErrorId("LANCE", "QUERY", "FAILED"),
|
|
2416
2421
|
domain: ErrorDomain.STORAGE,
|
|
2417
2422
|
category: ErrorCategory.THIRD_PARTY,
|
|
2418
2423
|
details: { tableName, includeVector, columnsCount: columns?.length, includeAllColumns }
|
|
@@ -2464,7 +2469,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2464
2469
|
} catch (error) {
|
|
2465
2470
|
throw new MastraError(
|
|
2466
2471
|
{
|
|
2467
|
-
id: "
|
|
2472
|
+
id: createVectorErrorId("LANCE", "UPSERT", "INVALID_ARGS"),
|
|
2468
2473
|
domain: ErrorDomain.STORAGE,
|
|
2469
2474
|
category: ErrorCategory.USER,
|
|
2470
2475
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2500,7 +2505,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2500
2505
|
} catch (error) {
|
|
2501
2506
|
throw new MastraError(
|
|
2502
2507
|
{
|
|
2503
|
-
id: "
|
|
2508
|
+
id: createVectorErrorId("LANCE", "UPSERT", "FAILED"),
|
|
2504
2509
|
domain: ErrorDomain.STORAGE,
|
|
2505
2510
|
category: ErrorCategory.THIRD_PARTY,
|
|
2506
2511
|
details: { tableName, vectorCount: vectors.length, metadataCount: metadata.length, idsCount: ids.length }
|
|
@@ -2527,7 +2532,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2527
2532
|
async createTable(tableName, data, options) {
|
|
2528
2533
|
if (!this.lanceClient) {
|
|
2529
2534
|
throw new MastraError({
|
|
2530
|
-
id: "
|
|
2535
|
+
id: createVectorErrorId("LANCE", "CREATE_TABLE", "INVALID_ARGS"),
|
|
2531
2536
|
domain: ErrorDomain.STORAGE,
|
|
2532
2537
|
category: ErrorCategory.USER,
|
|
2533
2538
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2542,7 +2547,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2542
2547
|
} catch (error) {
|
|
2543
2548
|
throw new MastraError(
|
|
2544
2549
|
{
|
|
2545
|
-
id: "
|
|
2550
|
+
id: createVectorErrorId("LANCE", "CREATE_TABLE", "FAILED"),
|
|
2546
2551
|
domain: ErrorDomain.STORAGE,
|
|
2547
2552
|
category: ErrorCategory.THIRD_PARTY,
|
|
2548
2553
|
details: { tableName }
|
|
@@ -2554,7 +2559,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2554
2559
|
async listTables() {
|
|
2555
2560
|
if (!this.lanceClient) {
|
|
2556
2561
|
throw new MastraError({
|
|
2557
|
-
id: "
|
|
2562
|
+
id: createVectorErrorId("LANCE", "LIST_TABLES", "INVALID_ARGS"),
|
|
2558
2563
|
domain: ErrorDomain.STORAGE,
|
|
2559
2564
|
category: ErrorCategory.USER,
|
|
2560
2565
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2566,7 +2571,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2566
2571
|
} catch (error) {
|
|
2567
2572
|
throw new MastraError(
|
|
2568
2573
|
{
|
|
2569
|
-
id: "
|
|
2574
|
+
id: createVectorErrorId("LANCE", "LIST_TABLES", "FAILED"),
|
|
2570
2575
|
domain: ErrorDomain.STORAGE,
|
|
2571
2576
|
category: ErrorCategory.THIRD_PARTY
|
|
2572
2577
|
},
|
|
@@ -2577,7 +2582,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2577
2582
|
async getTableSchema(tableName) {
|
|
2578
2583
|
if (!this.lanceClient) {
|
|
2579
2584
|
throw new MastraError({
|
|
2580
|
-
id: "
|
|
2585
|
+
id: createVectorErrorId("LANCE", "GET_TABLE_SCHEMA", "INVALID_ARGS"),
|
|
2581
2586
|
domain: ErrorDomain.STORAGE,
|
|
2582
2587
|
category: ErrorCategory.USER,
|
|
2583
2588
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2590,7 +2595,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2590
2595
|
} catch (error) {
|
|
2591
2596
|
throw new MastraError(
|
|
2592
2597
|
{
|
|
2593
|
-
id: "
|
|
2598
|
+
id: createVectorErrorId("LANCE", "GET_TABLE_SCHEMA", "FAILED"),
|
|
2594
2599
|
domain: ErrorDomain.STORAGE,
|
|
2595
2600
|
category: ErrorCategory.THIRD_PARTY,
|
|
2596
2601
|
details: { tableName }
|
|
@@ -2625,7 +2630,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2625
2630
|
} catch (err) {
|
|
2626
2631
|
throw new MastraError(
|
|
2627
2632
|
{
|
|
2628
|
-
id: "
|
|
2633
|
+
id: createVectorErrorId("LANCE", "CREATE_INDEX", "INVALID_ARGS"),
|
|
2629
2634
|
domain: ErrorDomain.STORAGE,
|
|
2630
2635
|
category: ErrorCategory.USER,
|
|
2631
2636
|
details: { tableName: tableName || "", indexName, dimension, metric }
|
|
@@ -2670,7 +2675,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2670
2675
|
} catch (error) {
|
|
2671
2676
|
throw new MastraError(
|
|
2672
2677
|
{
|
|
2673
|
-
id: "
|
|
2678
|
+
id: createVectorErrorId("LANCE", "CREATE_INDEX", "FAILED"),
|
|
2674
2679
|
domain: ErrorDomain.STORAGE,
|
|
2675
2680
|
category: ErrorCategory.THIRD_PARTY,
|
|
2676
2681
|
details: { tableName: tableName || "", indexName, dimension }
|
|
@@ -2682,7 +2687,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2682
2687
|
async listIndexes() {
|
|
2683
2688
|
if (!this.lanceClient) {
|
|
2684
2689
|
throw new MastraError({
|
|
2685
|
-
id: "
|
|
2690
|
+
id: createVectorErrorId("LANCE", "LIST_INDEXES", "INVALID_ARGS"),
|
|
2686
2691
|
domain: ErrorDomain.STORAGE,
|
|
2687
2692
|
category: ErrorCategory.USER,
|
|
2688
2693
|
text: "LanceDB client not initialized. Use LanceVectorStore.create() to create an instance",
|
|
@@ -2701,7 +2706,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2701
2706
|
} catch (error) {
|
|
2702
2707
|
throw new MastraError(
|
|
2703
2708
|
{
|
|
2704
|
-
id: "
|
|
2709
|
+
id: createVectorErrorId("LANCE", "LIST_INDEXES", "FAILED"),
|
|
2705
2710
|
domain: ErrorDomain.STORAGE,
|
|
2706
2711
|
category: ErrorCategory.THIRD_PARTY
|
|
2707
2712
|
},
|
|
@@ -2720,7 +2725,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2720
2725
|
} catch (err) {
|
|
2721
2726
|
throw new MastraError(
|
|
2722
2727
|
{
|
|
2723
|
-
id: "
|
|
2728
|
+
id: createVectorErrorId("LANCE", "DESCRIBE_INDEX", "INVALID_ARGS"),
|
|
2724
2729
|
domain: ErrorDomain.STORAGE,
|
|
2725
2730
|
category: ErrorCategory.USER,
|
|
2726
2731
|
details: { indexName }
|
|
@@ -2755,7 +2760,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2755
2760
|
} catch (error) {
|
|
2756
2761
|
throw new MastraError(
|
|
2757
2762
|
{
|
|
2758
|
-
id: "
|
|
2763
|
+
id: createVectorErrorId("LANCE", "DESCRIBE_INDEX", "FAILED"),
|
|
2759
2764
|
domain: ErrorDomain.STORAGE,
|
|
2760
2765
|
category: ErrorCategory.THIRD_PARTY,
|
|
2761
2766
|
details: { indexName }
|
|
@@ -2775,7 +2780,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2775
2780
|
} catch (err) {
|
|
2776
2781
|
throw new MastraError(
|
|
2777
2782
|
{
|
|
2778
|
-
id: "
|
|
2783
|
+
id: createVectorErrorId("LANCE", "DELETE_INDEX", "INVALID_ARGS"),
|
|
2779
2784
|
domain: ErrorDomain.STORAGE,
|
|
2780
2785
|
category: ErrorCategory.USER,
|
|
2781
2786
|
details: { indexName }
|
|
@@ -2798,7 +2803,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2798
2803
|
} catch (error) {
|
|
2799
2804
|
throw new MastraError(
|
|
2800
2805
|
{
|
|
2801
|
-
id: "
|
|
2806
|
+
id: createVectorErrorId("LANCE", "DELETE_INDEX", "FAILED"),
|
|
2802
2807
|
domain: ErrorDomain.STORAGE,
|
|
2803
2808
|
category: ErrorCategory.THIRD_PARTY,
|
|
2804
2809
|
details: { indexName }
|
|
@@ -2813,7 +2818,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2813
2818
|
async deleteAllTables() {
|
|
2814
2819
|
if (!this.lanceClient) {
|
|
2815
2820
|
throw new MastraError({
|
|
2816
|
-
id: "
|
|
2821
|
+
id: createVectorErrorId("LANCE", "DELETE_ALL_TABLES", "INVALID_ARGS"),
|
|
2817
2822
|
domain: ErrorDomain.STORAGE,
|
|
2818
2823
|
category: ErrorCategory.USER,
|
|
2819
2824
|
details: { methodName: "deleteAllTables" },
|
|
@@ -2825,7 +2830,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2825
2830
|
} catch (error) {
|
|
2826
2831
|
throw new MastraError(
|
|
2827
2832
|
{
|
|
2828
|
-
id: "
|
|
2833
|
+
id: createVectorErrorId("LANCE", "DELETE_ALL_TABLES", "FAILED"),
|
|
2829
2834
|
domain: ErrorDomain.STORAGE,
|
|
2830
2835
|
category: ErrorCategory.THIRD_PARTY,
|
|
2831
2836
|
details: { methodName: "deleteAllTables" }
|
|
@@ -2837,7 +2842,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2837
2842
|
async deleteTable(tableName) {
|
|
2838
2843
|
if (!this.lanceClient) {
|
|
2839
2844
|
throw new MastraError({
|
|
2840
|
-
id: "
|
|
2845
|
+
id: createVectorErrorId("LANCE", "DELETE_TABLE", "INVALID_ARGS"),
|
|
2841
2846
|
domain: ErrorDomain.STORAGE,
|
|
2842
2847
|
category: ErrorCategory.USER,
|
|
2843
2848
|
details: { tableName },
|
|
@@ -2849,7 +2854,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2849
2854
|
} catch (error) {
|
|
2850
2855
|
throw new MastraError(
|
|
2851
2856
|
{
|
|
2852
|
-
id: "
|
|
2857
|
+
id: createVectorErrorId("LANCE", "DELETE_TABLE", "FAILED"),
|
|
2853
2858
|
domain: ErrorDomain.STORAGE,
|
|
2854
2859
|
category: ErrorCategory.THIRD_PARTY,
|
|
2855
2860
|
details: { tableName }
|
|
@@ -2862,7 +2867,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2862
2867
|
const { indexName, update } = params;
|
|
2863
2868
|
if ("id" in params && "filter" in params && params.id && params.filter) {
|
|
2864
2869
|
throw new MastraError({
|
|
2865
|
-
id: "
|
|
2870
|
+
id: createVectorErrorId("LANCE", "UPDATE_VECTOR", "MUTUALLY_EXCLUSIVE"),
|
|
2866
2871
|
domain: ErrorDomain.STORAGE,
|
|
2867
2872
|
category: ErrorCategory.USER,
|
|
2868
2873
|
text: "id and filter are mutually exclusive",
|
|
@@ -2871,7 +2876,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2871
2876
|
}
|
|
2872
2877
|
if (!("id" in params || "filter" in params) || !params.id && !params.filter) {
|
|
2873
2878
|
throw new MastraError({
|
|
2874
|
-
id: "
|
|
2879
|
+
id: createVectorErrorId("LANCE", "UPDATE_VECTOR", "NO_TARGET"),
|
|
2875
2880
|
domain: ErrorDomain.STORAGE,
|
|
2876
2881
|
category: ErrorCategory.USER,
|
|
2877
2882
|
text: "Either id or filter must be provided",
|
|
@@ -2880,7 +2885,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2880
2885
|
}
|
|
2881
2886
|
if ("filter" in params && params.filter && Object.keys(params.filter).length === 0) {
|
|
2882
2887
|
throw new MastraError({
|
|
2883
|
-
id: "
|
|
2888
|
+
id: createVectorErrorId("LANCE", "UPDATE_VECTOR", "EMPTY_FILTER"),
|
|
2884
2889
|
domain: ErrorDomain.STORAGE,
|
|
2885
2890
|
category: ErrorCategory.USER,
|
|
2886
2891
|
text: "Cannot update with empty filter",
|
|
@@ -2889,7 +2894,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2889
2894
|
}
|
|
2890
2895
|
if (!update.vector && !update.metadata) {
|
|
2891
2896
|
throw new MastraError({
|
|
2892
|
-
id: "
|
|
2897
|
+
id: createVectorErrorId("LANCE", "UPDATE_VECTOR", "NO_PAYLOAD"),
|
|
2893
2898
|
domain: ErrorDomain.STORAGE,
|
|
2894
2899
|
category: ErrorCategory.USER,
|
|
2895
2900
|
text: "No updates provided",
|
|
@@ -2984,7 +2989,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2984
2989
|
if (error instanceof MastraError) throw error;
|
|
2985
2990
|
throw new MastraError(
|
|
2986
2991
|
{
|
|
2987
|
-
id: "
|
|
2992
|
+
id: createVectorErrorId("LANCE", "UPDATE_VECTOR", "FAILED"),
|
|
2988
2993
|
domain: ErrorDomain.STORAGE,
|
|
2989
2994
|
category: ErrorCategory.THIRD_PARTY,
|
|
2990
2995
|
details: {
|
|
@@ -3013,7 +3018,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3013
3018
|
} catch (err) {
|
|
3014
3019
|
throw new MastraError(
|
|
3015
3020
|
{
|
|
3016
|
-
id: "
|
|
3021
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTOR", "INVALID_ARGS"),
|
|
3017
3022
|
domain: ErrorDomain.STORAGE,
|
|
3018
3023
|
category: ErrorCategory.USER,
|
|
3019
3024
|
details: {
|
|
@@ -3046,7 +3051,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3046
3051
|
} catch (error) {
|
|
3047
3052
|
throw new MastraError(
|
|
3048
3053
|
{
|
|
3049
|
-
id: "
|
|
3054
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTOR", "FAILED"),
|
|
3050
3055
|
domain: ErrorDomain.STORAGE,
|
|
3051
3056
|
category: ErrorCategory.THIRD_PARTY,
|
|
3052
3057
|
details: {
|
|
@@ -3086,7 +3091,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3086
3091
|
async deleteVectors({ indexName, filter, ids }) {
|
|
3087
3092
|
if (ids && filter) {
|
|
3088
3093
|
throw new MastraError({
|
|
3089
|
-
id: "
|
|
3094
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTORS", "MUTUALLY_EXCLUSIVE"),
|
|
3090
3095
|
domain: ErrorDomain.STORAGE,
|
|
3091
3096
|
category: ErrorCategory.USER,
|
|
3092
3097
|
text: "ids and filter are mutually exclusive",
|
|
@@ -3095,7 +3100,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3095
3100
|
}
|
|
3096
3101
|
if (!ids && !filter) {
|
|
3097
3102
|
throw new MastraError({
|
|
3098
|
-
id: "
|
|
3103
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTORS", "NO_TARGET"),
|
|
3099
3104
|
domain: ErrorDomain.STORAGE,
|
|
3100
3105
|
category: ErrorCategory.USER,
|
|
3101
3106
|
text: "Either filter or ids must be provided",
|
|
@@ -3104,7 +3109,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3104
3109
|
}
|
|
3105
3110
|
if (ids && ids.length === 0) {
|
|
3106
3111
|
throw new MastraError({
|
|
3107
|
-
id: "
|
|
3112
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTORS", "EMPTY_IDS"),
|
|
3108
3113
|
domain: ErrorDomain.STORAGE,
|
|
3109
3114
|
category: ErrorCategory.USER,
|
|
3110
3115
|
text: "Cannot delete with empty ids array",
|
|
@@ -3113,7 +3118,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3113
3118
|
}
|
|
3114
3119
|
if (filter && Object.keys(filter).length === 0) {
|
|
3115
3120
|
throw new MastraError({
|
|
3116
|
-
id: "
|
|
3121
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTORS", "EMPTY_FILTER"),
|
|
3117
3122
|
domain: ErrorDomain.STORAGE,
|
|
3118
3123
|
category: ErrorCategory.USER,
|
|
3119
3124
|
text: "Cannot delete with empty filter",
|
|
@@ -3173,7 +3178,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
3173
3178
|
if (error instanceof MastraError) throw error;
|
|
3174
3179
|
throw new MastraError(
|
|
3175
3180
|
{
|
|
3176
|
-
id: "
|
|
3181
|
+
id: createVectorErrorId("LANCE", "DELETE_VECTORS", "FAILED"),
|
|
3177
3182
|
domain: ErrorDomain.STORAGE,
|
|
3178
3183
|
category: ErrorCategory.THIRD_PARTY,
|
|
3179
3184
|
details: {
|