@mastra/libsql 1.23.1-alpha.1 → 1.23.1-alpha.2

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
@@ -13502,7 +13502,7 @@ var WorkflowsLibSQL = class WorkflowsLibSQL extends WorkflowsStorage {
13502
13502
  }
13503
13503
  }, "deleteWorkflowRunById");
13504
13504
  }
13505
- async listWorkflowRuns({ workflowName, fromDate, toDate, page, perPage, resourceId, status } = {}) {
13505
+ async listWorkflowRuns({ workflowName, fromDate, toDate, page, perPage, resourceId, threadId, status } = {}) {
13506
13506
  try {
13507
13507
  const conditions = [];
13508
13508
  const args = [];
@@ -13526,6 +13526,10 @@ var WorkflowsLibSQL = class WorkflowsLibSQL extends WorkflowsStorage {
13526
13526
  conditions.push("resourceId = ?");
13527
13527
  args.push(resourceId);
13528
13528
  } else this.logger.warn(`[${TABLE_WORKFLOW_SNAPSHOT}] resourceId column not found. Skipping resourceId filter.`);
13529
+ if (threadId) {
13530
+ conditions.push(`(EXISTS (SELECT 1 FROM json_each(snapshot, '$.context') AS je WHERE json_extract(je.value, '$.status') = 'suspended' AND json_extract(je.value, '$.suspendPayload.__streamState.messageList.memoryInfo.threadId') = ?) OR json_extract(snapshot, '$.context.input.messageListState.memoryInfo.threadId') = ?)`);
13531
+ args.push(threadId, threadId);
13532
+ }
13529
13533
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
13530
13534
  let total = 0;
13531
13535
  const usePagination = typeof perPage === "number" && typeof page === "number";