@mastra/libsql 1.0.0-beta.4 → 1.0.0-beta.5

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
@@ -2753,11 +2753,11 @@ var ScoresLibSQL = class extends ScoresStorage {
2753
2753
  domain: ErrorDomain.STORAGE,
2754
2754
  category: ErrorCategory.USER,
2755
2755
  details: {
2756
- scorer: score.scorer.id,
2757
- entityId: score.entityId,
2758
- entityType: score.entityType,
2759
- traceId: score.traceId || "",
2760
- spanId: score.spanId || ""
2756
+ scorer: score.scorer?.id ?? "unknown",
2757
+ entityId: score.entityId ?? "unknown",
2758
+ entityType: score.entityType ?? "unknown",
2759
+ traceId: score.traceId ?? "",
2760
+ spanId: score.spanId ?? ""
2761
2761
  }
2762
2762
  },
2763
2763
  error
@@ -2765,17 +2765,17 @@ var ScoresLibSQL = class extends ScoresStorage {
2765
2765
  }
2766
2766
  try {
2767
2767
  const id = crypto.randomUUID();
2768
+ const now = /* @__PURE__ */ new Date();
2768
2769
  await this.operations.insert({
2769
2770
  tableName: TABLE_SCORERS,
2770
2771
  record: {
2772
+ ...parsedScore,
2771
2773
  id,
2772
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2773
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2774
- ...parsedScore
2774
+ createdAt: now.toISOString(),
2775
+ updatedAt: now.toISOString()
2775
2776
  }
2776
2777
  });
2777
- const scoreFromDb = await this.getScoreById({ id });
2778
- return { score: scoreFromDb };
2778
+ return { score: { ...parsedScore, id, createdAt: now, updatedAt: now } };
2779
2779
  } catch (error) {
2780
2780
  throw new MastraError(
2781
2781
  {