@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/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
- const { threadId, resourceId, selectBy, format = "v1" } = args;
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
- throw new MastraError(
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.log(await table.schema());
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,