@mastra/libsql 0.0.0-add-libsql-changeset-20250910154739 → 0.0.0-add-save-score-validation-on-stores-20250911031242
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/CHANGELOG.md +6 -4
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { MastraVector } from '@mastra/core/vector';
|
|
|
5
5
|
import { BaseFilterTranslator } from '@mastra/core/vector/filter';
|
|
6
6
|
import { MastraStorage, StoreOperations, TABLE_WORKFLOW_SNAPSHOT, TABLE_AI_SPANS, ScoresStorage, TABLE_SCORERS, safelyParseJSON, TracesStorage, TABLE_TRACES, WorkflowsStorage, MemoryStorage, resolveMessageLimit, TABLE_MESSAGES, TABLE_THREADS, TABLE_RESOURCES, LegacyEvalsStorage, TABLE_EVALS, ObservabilityStorage, TABLE_SCHEMAS, AI_SPAN_SCHEMA } from '@mastra/core/storage';
|
|
7
7
|
import { MessageList } from '@mastra/core/agent';
|
|
8
|
+
import { saveScorePayloadSchema } from '@mastra/core/scores';
|
|
8
9
|
|
|
9
10
|
// src/vector/index.ts
|
|
10
11
|
var LibSQLFilterTranslator = class extends BaseFilterTranslator {
|
|
@@ -2704,6 +2705,7 @@ var ScoresLibSQL = class extends ScoresStorage {
|
|
|
2704
2705
|
}
|
|
2705
2706
|
async saveScore(score) {
|
|
2706
2707
|
try {
|
|
2708
|
+
const scoreData = saveScorePayloadSchema.parse(score);
|
|
2707
2709
|
const id = crypto.randomUUID();
|
|
2708
2710
|
await this.operations.insert({
|
|
2709
2711
|
tableName: TABLE_SCORERS,
|
|
@@ -2711,7 +2713,7 @@ var ScoresLibSQL = class extends ScoresStorage {
|
|
|
2711
2713
|
id,
|
|
2712
2714
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2713
2715
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2714
|
-
...
|
|
2716
|
+
...scoreData
|
|
2715
2717
|
}
|
|
2716
2718
|
});
|
|
2717
2719
|
const scoreFromDb = await this.getScoreById({ id });
|