@mastra/dynamodb 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
@@ -1305,6 +1305,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1305
1305
  }) {
1306
1306
  this.logger.debug("Getting messages", { threadId, selectBy });
1307
1307
  try {
1308
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
1308
1309
  const messages = [];
1309
1310
  const limit = resolveMessageLimit({ last: selectBy?.last, defaultLimit: Number.MAX_SAFE_INTEGER });
1310
1311
  if (selectBy?.include?.length) {
@@ -1353,7 +1354,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1353
1354
  id: "STORAGE_DYNAMODB_STORE_GET_MESSAGES_FAILED",
1354
1355
  domain: ErrorDomain.STORAGE,
1355
1356
  category: ErrorCategory.THIRD_PARTY,
1356
- details: { threadId }
1357
+ details: { threadId, resourceId: resourceId ?? "" }
1357
1358
  },
1358
1359
  error
1359
1360
  );
@@ -1508,6 +1509,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1508
1509
  const limit = resolveMessageLimit({ last: selectBy?.last, defaultLimit: Number.MAX_SAFE_INTEGER });
1509
1510
  this.logger.debug("Getting messages with pagination", { threadId, page, perPage, fromDate, toDate, limit });
1510
1511
  try {
1512
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
1511
1513
  let messages = [];
1512
1514
  if (selectBy?.include?.length) {
1513
1515
  const includeMessages = await this._getIncludedMessages(threadId, selectBy);
@@ -1563,19 +1565,23 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1563
1565
  hasMore
1564
1566
  };
1565
1567
  } catch (error) {
1566
- throw new MastraError(
1568
+ const mastraError = new MastraError(
1567
1569
  {
1568
1570
  id: "STORAGE_DYNAMODB_STORE_GET_MESSAGES_PAGINATED_FAILED",
1569
1571
  domain: ErrorDomain.STORAGE,
1570
1572
  category: ErrorCategory.THIRD_PARTY,
1571
- details: { threadId }
1573
+ details: { threadId, resourceId: resourceId ?? "" }
1572
1574
  },
1573
1575
  error
1574
1576
  );
1577
+ this.logger?.trackException?.(mastraError);
1578
+ this.logger?.error?.(mastraError.toString());
1579
+ return { messages: [], total: 0, page, perPage, hasMore: false };
1575
1580
  }
1576
1581
  }
1577
1582
  // Helper method to get included messages with context
1578
1583
  async _getIncludedMessages(threadId, selectBy) {
1584
+ if (!threadId.trim()) throw new Error("threadId must be a non-empty string");
1579
1585
  if (!selectBy?.include?.length) {
1580
1586
  return [];
1581
1587
  }
@@ -2620,11 +2626,11 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2620
2626
  async persistWorkflowSnapshot({
2621
2627
  workflowName,
2622
2628
  runId,
2629
+ resourceId,
2623
2630
  snapshot
2624
2631
  }) {
2625
2632
  this.logger.debug("Persisting workflow snapshot", { workflowName, runId });
2626
2633
  try {
2627
- const resourceId = "resourceId" in snapshot ? snapshot.resourceId : void 0;
2628
2634
  const now = (/* @__PURE__ */ new Date()).toISOString();
2629
2635
  const data = {
2630
2636
  entity: "workflow_snapshot",
@@ -2750,8 +2756,6 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2750
2756
  async getWorkflowRunById(args) {
2751
2757
  const { runId, workflowName } = args;
2752
2758
  this.logger.debug("Getting workflow run by ID", { runId, workflowName });
2753
- console.log("workflowName", workflowName);
2754
- console.log("runId", runId);
2755
2759
  try {
2756
2760
  if (workflowName) {
2757
2761
  this.logger.debug("WorkflowName provided, using direct GET operation.");
@@ -2761,7 +2765,6 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2761
2765
  workflow_name: workflowName,
2762
2766
  run_id: runId
2763
2767
  }).go();
2764
- console.log("result", result2);
2765
2768
  if (!result2.data) {
2766
2769
  return null;
2767
2770
  }
@@ -3033,9 +3036,10 @@ var DynamoDBStore = class extends MastraStorage {
3033
3036
  async persistWorkflowSnapshot({
3034
3037
  workflowName,
3035
3038
  runId,
3039
+ resourceId,
3036
3040
  snapshot
3037
3041
  }) {
3038
- return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, snapshot });
3042
+ return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot });
3039
3043
  }
3040
3044
  async loadWorkflowSnapshot({
3041
3045
  workflowName,