@mastra/lance 0.0.0-vector-query-tool-provider-options-20250828222356 → 0.0.0-vector-extension-schema-20250922130418
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 +159 -3
- package/dist/index.cjs +24 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -13
- 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/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +2 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +20 -7
- package/eslint.config.js +0 -6
- package/src/index.ts +0 -2
- package/src/storage/domains/legacy-evals/index.ts +0 -156
- package/src/storage/domains/memory/index.ts +0 -1000
- package/src/storage/domains/operations/index.ts +0 -489
- package/src/storage/domains/scores/index.ts +0 -243
- package/src/storage/domains/traces/index.ts +0 -212
- package/src/storage/domains/utils.ts +0 -158
- package/src/storage/domains/workflows/index.ts +0 -245
- package/src/storage/index.test.ts +0 -10
- package/src/storage/index.ts +0 -494
- package/src/vector/filter.test.ts +0 -295
- package/src/vector/filter.ts +0 -443
- package/src/vector/index.test.ts +0 -1493
- package/src/vector/index.ts +0 -941
- package/src/vector/types.ts +0 -16
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -5
- package/tsup.config.ts +0 -17
- package/vitest.config.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -187,7 +187,6 @@ function processResultWithTypeConversion(rawResult, tableSchema) {
|
|
|
187
187
|
} else if (fieldTypeStr.includes("float64") && ["createdAt", "updatedAt"].includes(key)) {
|
|
188
188
|
processedResult[key] = new Date(processedResult[key]);
|
|
189
189
|
}
|
|
190
|
-
console.log(key, "processedResult", processedResult);
|
|
191
190
|
}
|
|
192
191
|
return processedResult;
|
|
193
192
|
}
|
|
@@ -401,6 +400,7 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
401
400
|
threadConfig
|
|
402
401
|
}) {
|
|
403
402
|
try {
|
|
403
|
+
if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
|
|
404
404
|
if (threadConfig) {
|
|
405
405
|
throw new Error("ThreadConfig is not supported by LanceDB storage");
|
|
406
406
|
}
|
|
@@ -441,7 +441,11 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
441
441
|
{
|
|
442
442
|
id: "LANCE_STORE_GET_MESSAGES_FAILED",
|
|
443
443
|
domain: ErrorDomain.STORAGE,
|
|
444
|
-
category: ErrorCategory.THIRD_PARTY
|
|
444
|
+
category: ErrorCategory.THIRD_PARTY,
|
|
445
|
+
details: {
|
|
446
|
+
threadId,
|
|
447
|
+
resourceId: resourceId ?? ""
|
|
448
|
+
}
|
|
445
449
|
},
|
|
446
450
|
error
|
|
447
451
|
);
|
|
@@ -612,13 +616,11 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
612
616
|
return Array.from(allIndices).sort((a, b) => a - b).map((index) => records[index]);
|
|
613
617
|
}
|
|
614
618
|
async getMessagesPaginated(args) {
|
|
619
|
+
const { threadId, resourceId, selectBy, format = "v1" } = args;
|
|
620
|
+
const page = selectBy?.pagination?.page ?? 0;
|
|
621
|
+
const perPage = selectBy?.pagination?.perPage ?? 10;
|
|
615
622
|
try {
|
|
616
|
-
|
|
617
|
-
if (!threadId) {
|
|
618
|
-
throw new Error("Thread ID is required for getMessagesPaginated");
|
|
619
|
-
}
|
|
620
|
-
const page = selectBy?.pagination?.page ?? 0;
|
|
621
|
-
const perPage = selectBy?.pagination?.perPage ?? 10;
|
|
623
|
+
if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
|
|
622
624
|
const dateRange = selectBy?.pagination?.dateRange;
|
|
623
625
|
const fromDate = dateRange?.start;
|
|
624
626
|
const toDate = dateRange?.end;
|
|
@@ -720,14 +722,21 @@ var StoreMemoryLance = class extends MemoryStorage {
|
|
|
720
722
|
hasMore: total > (page + 1) * perPage
|
|
721
723
|
};
|
|
722
724
|
} catch (error) {
|
|
723
|
-
|
|
725
|
+
const mastraError = new MastraError(
|
|
724
726
|
{
|
|
725
727
|
id: "LANCE_STORE_GET_MESSAGES_PAGINATED_FAILED",
|
|
726
728
|
domain: ErrorDomain.STORAGE,
|
|
727
|
-
category: ErrorCategory.THIRD_PARTY
|
|
729
|
+
category: ErrorCategory.THIRD_PARTY,
|
|
730
|
+
details: {
|
|
731
|
+
threadId,
|
|
732
|
+
resourceId: resourceId ?? ""
|
|
733
|
+
}
|
|
728
734
|
},
|
|
729
735
|
error
|
|
730
736
|
);
|
|
737
|
+
this.logger?.trackException?.(mastraError);
|
|
738
|
+
this.logger?.error?.(mastraError.toString());
|
|
739
|
+
return { messages: [], total: 0, page, perPage, hasMore: false };
|
|
731
740
|
}
|
|
732
741
|
}
|
|
733
742
|
/**
|
|
@@ -1254,7 +1263,7 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1254
1263
|
processedRecord[key] = JSON.stringify(processedRecord[key]);
|
|
1255
1264
|
}
|
|
1256
1265
|
}
|
|
1257
|
-
console.
|
|
1266
|
+
console.info(await table.schema());
|
|
1258
1267
|
await table.mergeInsert(primaryId).whenMatchedUpdateAll().whenNotMatchedInsertAll().execute([processedRecord]);
|
|
1259
1268
|
} catch (error) {
|
|
1260
1269
|
throw new MastraError(
|
|
@@ -1304,7 +1313,6 @@ var StoreOperationsLance = class extends StoreOperations {
|
|
|
1304
1313
|
}
|
|
1305
1314
|
return processedRecord;
|
|
1306
1315
|
});
|
|
1307
|
-
console.log(processedRecords);
|
|
1308
1316
|
await table.mergeInsert(primaryId).whenMatchedUpdateAll().whenNotMatchedInsertAll().execute(processedRecords);
|
|
1309
1317
|
} catch (error) {
|
|
1310
1318
|
throw new MastraError(
|
|
@@ -1806,6 +1814,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1806
1814
|
async persistWorkflowSnapshot({
|
|
1807
1815
|
workflowName,
|
|
1808
1816
|
runId,
|
|
1817
|
+
resourceId,
|
|
1809
1818
|
snapshot
|
|
1810
1819
|
}) {
|
|
1811
1820
|
try {
|
|
@@ -1822,6 +1831,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1822
1831
|
const record = {
|
|
1823
1832
|
workflow_name: workflowName,
|
|
1824
1833
|
run_id: runId,
|
|
1834
|
+
resourceId,
|
|
1825
1835
|
snapshot: JSON.stringify(snapshot),
|
|
1826
1836
|
createdAt,
|
|
1827
1837
|
updatedAt: now
|
|
@@ -2191,9 +2201,10 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
2191
2201
|
async persistWorkflowSnapshot({
|
|
2192
2202
|
workflowName,
|
|
2193
2203
|
runId,
|
|
2204
|
+
resourceId,
|
|
2194
2205
|
snapshot
|
|
2195
2206
|
}) {
|
|
2196
|
-
return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
2207
|
+
return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot });
|
|
2197
2208
|
}
|
|
2198
2209
|
async loadWorkflowSnapshot({
|
|
2199
2210
|
workflowName,
|