@mastra/libsql 0.13.1 → 0.13.2-alpha.1

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.1 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,25 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 0.13.2-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b5cf2a3: make system message always available during agent calls
8
+ - Updated dependencies [b5cf2a3]
9
+ - @mastra/core@0.13.2-alpha.3
10
+
11
+ ## 0.13.2-alpha.0
12
+
13
+ ### Patch Changes
14
+
15
+ - b32c50d: Filter scores by source
16
+ - Updated dependencies [d5330bf]
17
+ - Updated dependencies [a239d41]
18
+ - Updated dependencies [b32c50d]
19
+ - Updated dependencies [121a3f8]
20
+ - Updated dependencies [ec510e7]
21
+ - @mastra/core@0.13.2-alpha.2
22
+
3
23
  ## 0.13.1
4
24
 
5
25
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1460,7 +1460,6 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
1460
1460
  };
1461
1461
  }
1462
1462
  async saveResource({ resource }) {
1463
- console.log("resource", resource);
1464
1463
  await this.operations.insert({
1465
1464
  tableName: storage.TABLE_RESOURCES,
1466
1465
  record: {
@@ -2060,6 +2059,7 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
2060
2059
  scorerId,
2061
2060
  entityId,
2062
2061
  entityType,
2062
+ source,
2063
2063
  pagination
2064
2064
  }) {
2065
2065
  try {
@@ -2077,6 +2077,10 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
2077
2077
  conditions.push(`entityType = ?`);
2078
2078
  queryParams.push(entityType);
2079
2079
  }
2080
+ if (source) {
2081
+ conditions.push(`source = ?`);
2082
+ queryParams.push(source);
2083
+ }
2080
2084
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
2081
2085
  const result = await this.client.execute({
2082
2086
  sql: `SELECT * FROM ${storage.TABLE_SCORERS} ${whereClause} ORDER BY createdAt DESC LIMIT ? OFFSET ?`,
@@ -2103,15 +2107,15 @@ var ScoresLibSQL = class extends storage.ScoresStorage {
2103
2107
  }
2104
2108
  }
2105
2109
  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;
2110
+ const scorerValue = storage.safelyParseJSON(row.scorer);
2111
+ const inputValue = storage.safelyParseJSON(row.input ?? "{}");
2112
+ const outputValue = storage.safelyParseJSON(row.output ?? "{}");
2113
+ const additionalLLMContextValue = row.additionalLLMContext ? storage.safelyParseJSON(row.additionalLLMContext) : null;
2114
+ const runtimeContextValue = row.runtimeContext ? storage.safelyParseJSON(row.runtimeContext) : null;
2115
+ const metadataValue = row.metadata ? storage.safelyParseJSON(row.metadata) : null;
2116
+ const entityValue = row.entity ? storage.safelyParseJSON(row.entity) : null;
2117
+ const preprocessStepResultValue = row.preprocessStepResult ? storage.safelyParseJSON(row.preprocessStepResult) : null;
2118
+ const analyzeStepResultValue = row.analyzeStepResult ? storage.safelyParseJSON(row.analyzeStepResult) : null;
2115
2119
  return {
2116
2120
  id: row.id,
2117
2121
  traceId: row.traceId,
@@ -2632,9 +2636,10 @@ var LibSQLStore = class extends storage.MastraStorage {
2632
2636
  scorerId,
2633
2637
  entityId,
2634
2638
  entityType,
2639
+ source,
2635
2640
  pagination
2636
2641
  }) {
2637
- return this.stores.scores.getScoresByScorerId({ scorerId, entityId, entityType, pagination });
2642
+ return this.stores.scores.getScoresByScorerId({ scorerId, entityId, entityType, source, pagination });
2638
2643
  }
2639
2644
  async getScoresByRunId({
2640
2645
  runId,