@mastra/lance 1.0.0-beta.0 → 1.0.0-beta.1

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
@@ -1553,11 +1553,13 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
1553
1553
  } else {
1554
1554
  createdAt = now;
1555
1555
  }
1556
+ const { status, value, ...rest } = snapshot;
1556
1557
  const record = {
1557
1558
  workflow_name: workflowName,
1558
1559
  run_id: runId,
1559
1560
  resourceId,
1560
- snapshot: JSON.stringify(snapshot),
1561
+ snapshot: JSON.stringify({ status, value, ...rest }),
1562
+ // this is to ensure status is always just before value, for when querying the db by status
1561
1563
  createdAt,
1562
1564
  updatedAt: now
1563
1565
  };
@@ -1627,6 +1629,10 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
1627
1629
  if (args?.workflowName) {
1628
1630
  conditions.push(`workflow_name = '${args.workflowName.replace(/'/g, "''")}'`);
1629
1631
  }
1632
+ if (args?.status) {
1633
+ const escapedStatus = args.status.replace(/\\/g, "\\\\").replace(/'/g, "''").replace(/%/g, "\\%").replace(/_/g, "\\_");
1634
+ conditions.push(`\`snapshot\` LIKE '%"status":"${escapedStatus}","value"%'`);
1635
+ }
1630
1636
  if (args?.resourceId) {
1631
1637
  conditions.push(`\`resourceId\` = '${args.resourceId}'`);
1632
1638
  }