@mastra/mongodb 1.18.9 → 1.18.10

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
@@ -9,7 +9,7 @@ import { MessageList } from "@mastra/core/agent";
9
9
  import { saveScorePayloadSchema } from "@mastra/core/evals";
10
10
  import { skillSnapshotFieldValuesEqual } from "@mastra/core/storage/domains/skills";
11
11
  //#region package.json
12
- var version = "1.18.9";
12
+ var version = "1.18.10";
13
13
  //#endregion
14
14
  //#region src/vector/filter.ts
15
15
  /**
@@ -2778,9 +2778,9 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
2778
2778
  name: row.name,
2779
2779
  description: row.description ?? void 0,
2780
2780
  metadata: typeof row.metadata === "string" ? safelyParseJSON(row.metadata) : row.metadata ?? void 0,
2781
- inputSchema: typeof row.inputSchema === "string" ? safelyParseJSON(row.inputSchema) : row.inputSchema,
2782
- groundTruthSchema: typeof row.groundTruthSchema === "string" ? safelyParseJSON(row.groundTruthSchema) : row.groundTruthSchema,
2783
- requestContextSchema: typeof row.requestContextSchema === "string" ? safelyParseJSON(row.requestContextSchema) : row.requestContextSchema,
2781
+ inputSchema: (typeof row.inputSchema === "string" ? safelyParseJSON(row.inputSchema) : row.inputSchema) ?? void 0,
2782
+ groundTruthSchema: (typeof row.groundTruthSchema === "string" ? safelyParseJSON(row.groundTruthSchema) : row.groundTruthSchema) ?? void 0,
2783
+ requestContextSchema: (typeof row.requestContextSchema === "string" ? safelyParseJSON(row.requestContextSchema) : row.requestContextSchema) ?? void 0,
2784
2784
  tags: typeof row.tags === "string" ? safelyParseJSON(row.tags) : row.tags ?? void 0,
2785
2785
  targetType: row.targetType ?? void 0,
2786
2786
  targetIds: typeof row.targetIds === "string" ? safelyParseJSON(row.targetIds) : row.targetIds ?? void 0,
@@ -2804,9 +2804,9 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
2804
2804
  externalId: row.externalId ?? null,
2805
2805
  organizationId: row.organizationId ?? null,
2806
2806
  projectId: row.projectId ?? null,
2807
- input: typeof row.input === "string" ? safelyParseJSON(row.input) : row.input,
2808
- groundTruth: typeof row.groundTruth === "string" ? safelyParseJSON(row.groundTruth) : row.groundTruth,
2809
- expectedTrajectory: typeof row.expectedTrajectory === "string" ? safelyParseJSON(row.expectedTrajectory) : row.expectedTrajectory,
2807
+ input: row.input,
2808
+ groundTruth: row.groundTruth,
2809
+ expectedTrajectory: row.expectedTrajectory,
2810
2810
  toolMocks: (typeof row.toolMocks === "string" ? safelyParseJSON(row.toolMocks) : row.toolMocks) ?? emptyValue,
2811
2811
  unmockedToolPolicy: row.unmockedToolPolicy ?? emptyValue,
2812
2812
  scorerIds: (typeof row.scorerIds === "string" ? safelyParseJSON(row.scorerIds) : row.scorerIds) ?? emptyValue,
@@ -3057,8 +3057,8 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3057
3057
  validTo: null,
3058
3058
  isDeleted: false,
3059
3059
  input: args.input,
3060
- groundTruth: args.groundTruth ?? null,
3061
- expectedTrajectory: args.expectedTrajectory ?? null,
3060
+ groundTruth: args.groundTruth,
3061
+ expectedTrajectory: args.expectedTrajectory,
3062
3062
  toolMocks: args.toolMocks ?? null,
3063
3063
  unmockedToolPolicy: args.unmockedToolPolicy ?? null,
3064
3064
  scorerIds: args.scorerIds ?? null,
@@ -3067,7 +3067,10 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3067
3067
  source: args.source ?? null,
3068
3068
  createdAt: now,
3069
3069
  updatedAt: now
3070
- }, { session });
3070
+ }, {
3071
+ session,
3072
+ ignoreUndefined: true
3073
+ });
3071
3074
  await versionsCollection.insertOne({
3072
3075
  id: versionId,
3073
3076
  datasetId: args.datasetId,
@@ -3201,7 +3204,7 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3201
3204
  isDeleted: false,
3202
3205
  input: mergedInput,
3203
3206
  groundTruth: mergedGroundTruth,
3204
- expectedTrajectory: mergedExpectedTrajectory ?? null,
3207
+ expectedTrajectory: mergedExpectedTrajectory,
3205
3208
  toolMocks: mergedToolMocks ?? null,
3206
3209
  unmockedToolPolicy: mergedUnmockedToolPolicy ?? null,
3207
3210
  scorerIds: mergedScorerIds ?? null,
@@ -3210,7 +3213,10 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3210
3213
  source: mergedSource,
3211
3214
  createdAt: existing.createdAt,
3212
3215
  updatedAt: now
3213
- }, { session });
3216
+ }, {
3217
+ session,
3218
+ ignoreUndefined: true
3219
+ });
3214
3220
  await versionsCollection.insertOne({
3215
3221
  id: versionId,
3216
3222
  datasetId: args.datasetId,
@@ -3298,7 +3304,7 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3298
3304
  isDeleted: true,
3299
3305
  input: existing.input,
3300
3306
  groundTruth: existing.groundTruth,
3301
- expectedTrajectory: existing.expectedTrajectory ?? null,
3307
+ expectedTrajectory: existing.expectedTrajectory,
3302
3308
  toolMocks: existing.toolMocks ?? null,
3303
3309
  unmockedToolPolicy: existing.unmockedToolPolicy ?? null,
3304
3310
  scorerIds: existing.scorerIds ?? null,
@@ -3307,7 +3313,10 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3307
3313
  source: existing.source,
3308
3314
  createdAt: existing.createdAt,
3309
3315
  updatedAt: now
3310
- }, { session });
3316
+ }, {
3317
+ session,
3318
+ ignoreUndefined: true
3319
+ });
3311
3320
  await versionsCollection.insertOne({
3312
3321
  id: versionId,
3313
3322
  datasetId,
@@ -3459,7 +3468,10 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3459
3468
  ...item,
3460
3469
  validTo: null,
3461
3470
  isDeleted: false
3462
- }, { session });
3471
+ }, {
3472
+ session,
3473
+ ignoreUndefined: true
3474
+ });
3463
3475
  resolved.set(item.id, item);
3464
3476
  }
3465
3477
  await versionsCollection.insertOne({
@@ -3527,7 +3539,7 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3527
3539
  isDeleted: true,
3528
3540
  input: item.input,
3529
3541
  groundTruth: item.groundTruth,
3530
- expectedTrajectory: item.expectedTrajectory ?? null,
3542
+ expectedTrajectory: item.expectedTrajectory,
3531
3543
  toolMocks: item.toolMocks ?? null,
3532
3544
  unmockedToolPolicy: item.unmockedToolPolicy ?? null,
3533
3545
  scorerIds: item.scorerIds ?? null,
@@ -3542,7 +3554,10 @@ var MongoDBDatasetsStorage = class extends DatasetsStorage {
3542
3554
  validTo: null,
3543
3555
  isDeleted: false
3544
3556
  }, { $set: { validTo: newVersion } }, { session });
3545
- await itemsCollection.insertMany(tombstones, { session });
3557
+ await itemsCollection.insertMany(tombstones, {
3558
+ session,
3559
+ ignoreUndefined: true
3560
+ });
3546
3561
  await versionsCollection.insertOne({
3547
3562
  id: versionId,
3548
3563
  datasetId: input.datasetId,