@mastra/libsql 0.13.1 → 0.13.2-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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @mastra/libsql@0.13.1-alpha.0 build /home/runner/work/mastra/mastra/stores/libsql
2
+ > @mastra/libsql@0.13.2-alpha.0 build /home/runner/work/mastra/mastra/stores/libsql
3
3
  > tsup --silent --config tsup.config.ts
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 0.13.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - b32c50d: Filter scores by source
8
+ - Updated dependencies [d5330bf]
9
+ - Updated dependencies [a239d41]
10
+ - Updated dependencies [b32c50d]
11
+ - Updated dependencies [121a3f8]
12
+ - Updated dependencies [ec510e7]
13
+ - @mastra/core@0.13.2-alpha.2
14
+
3
15
  ## 0.13.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -2060,6 +2060,7 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
2060
2060
  scorerId,
2061
2061
  entityId,
2062
2062
  entityType,
2063
+ source,
2063
2064
  pagination
2064
2065
  }) {
2065
2066
  try {
@@ -2077,6 +2078,10 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
2077
2078
  conditions.push(`entityType = ?`);
2078
2079
  queryParams.push(entityType);
2079
2080
  }
2081
+ if (source) {
2082
+ conditions.push(`source = ?`);
2083
+ queryParams.push(source);
2084
+ }
2080
2085
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
2081
2086
  const result = await this.client.execute({
2082
2087
  sql: `SELECT * FROM ${storage.TABLE_SCORERS} ${whereClause} ORDER BY createdAt DESC LIMIT ? OFFSET ?`,
@@ -2103,15 +2108,15 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
2103
2108
  }
2104
2109
  }
2105
2110
  transformScoreRow(row) {
2106
- const scorerValue = JSON.parse(row.scorer ?? "{}");
2107
- const inputValue = JSON.parse(row.input ?? "{}");
2108
- const outputValue = JSON.parse(row.output ?? "{}");
2109
- const additionalLLMContextValue = row.additionalLLMContext ? JSON.parse(row.additionalLLMContext) : null;
2110
- const runtimeContextValue = row.runtimeContext ? JSON.parse(row.runtimeContext) : null;
2111
- const metadataValue = row.metadata ? JSON.parse(row.metadata) : null;
2112
- const entityValue = row.entity ? JSON.parse(row.entity) : null;
2113
- const preprocessStepResultValue = row.preprocessStepResult ? JSON.parse(row.preprocessStepResult) : null;
2114
- const analyzeStepResultValue = row.analyzeStepResult ? JSON.parse(row.analyzeStepResult) : null;
2111
+ const scorerValue = storage.safelyParseJSON(row.scorer);
2112
+ const inputValue = storage.safelyParseJSON(row.input ?? "{}");
2113
+ const outputValue = storage.safelyParseJSON(row.output ?? "{}");
2114
+ const additionalLLMContextValue = row.additionalLLMContext ? storage.safelyParseJSON(row.additionalLLMContext) : null;
2115
+ const runtimeContextValue = row.runtimeContext ? storage.safelyParseJSON(row.runtimeContext) : null;
2116
+ const metadataValue = row.metadata ? storage.safelyParseJSON(row.metadata) : null;
2117
+ const entityValue = row.entity ? storage.safelyParseJSON(row.entity) : null;
2118
+ const preprocessStepResultValue = row.preprocessStepResult ? storage.safelyParseJSON(row.preprocessStepResult) : null;
2119
+ const analyzeStepResultValue = row.analyzeStepResult ? storage.safelyParseJSON(row.analyzeStepResult) : null;
2115
2120
  return {
2116
2121
  id: row.id,
2117
2122
  traceId: row.traceId,
@@ -2632,9 +2637,10 @@ var LibSQLStore = class extends storage.MastraStorage {
2632
2637
  scorerId,
2633
2638
  entityId,
2634
2639
  entityType,
2640
+ source,
2635
2641
  pagination
2636
2642
  }) {
2637
- return this.stores.scores.getScoresByScorerId({ scorerId, entityId, entityType, pagination });
2643
+ return this.stores.scores.getScoresByScorerId({ scorerId, entityId, entityType, source, pagination });
2638
2644
  }
2639
2645
  async getScoresByRunId({
2640
2646
  runId,