@mastra/mongodb 1.22.0-alpha.1 → 1.22.1-alpha.0

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
@@ -8,7 +8,7 @@ import { MessageList } from "@mastra/core/agent";
8
8
  import { saveScorePayloadSchema } from "@mastra/core/evals";
9
9
  import { skillSnapshotFieldValuesEqual } from "@mastra/core/storage/domains/skills";
10
10
  //#region package.json
11
- var version = "1.22.0-alpha.1";
11
+ var version = "1.22.1-alpha.0";
12
12
  //#endregion
13
13
  //#region src/vector/filter.ts
14
14
  /**
@@ -11591,10 +11591,12 @@ var WorkflowsStorageMongoDB = class WorkflowsStorageMongoDB extends WorkflowsSto
11591
11591
  async dangerouslyClearAll() {
11592
11592
  await (await this.getCollection(TABLE_WORKFLOW_SNAPSHOT)).deleteMany({});
11593
11593
  }
11594
- async updateWorkflowResults({ workflowName, runId, stepId, result, requestContext }) {
11594
+ async updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, state }) {
11595
11595
  try {
11596
11596
  const collection = await this.getCollection(TABLE_WORKFLOW_SNAPSHOT);
11597
11597
  const now = /* @__PURE__ */ new Date();
11598
+ const contextUpdate = { [stepId]: result };
11599
+ if (state !== void 0) contextUpdate.__state = state;
11598
11600
  const defaultSnapshot = {
11599
11601
  context: {},
11600
11602
  activePaths: [],
@@ -11617,7 +11619,7 @@ var WorkflowsStorageMongoDB = class WorkflowsStorageMongoDB extends WorkflowsSto
11617
11619
  run_id: runId,
11618
11620
  snapshot: { $mergeObjects: [
11619
11621
  { $ifNull: ["$snapshot", defaultSnapshot] },
11620
- { context: { $mergeObjects: [{ $ifNull: [{ $ifNull: ["$snapshot.context", {}] }, {}] }, { [stepId]: result }] } },
11622
+ { context: { $mergeObjects: [{ $ifNull: [{ $ifNull: ["$snapshot.context", {}] }, {}] }, contextUpdate] } },
11621
11623
  { requestContext: { $mergeObjects: [{ $ifNull: [{ $ifNull: ["$snapshot.requestContext", {}] }, {}] }, requestContext] } }
11622
11624
  ] },
11623
11625
  updatedAt: now,