@mastra/libsql 1.7.3-alpha.1 → 1.7.3-alpha.2

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 1.7.3-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Add `getReviewSummary()` to experiments storage for aggregating review status counts ([#14649](https://github.com/mastra-ai/mastra/pull/14649))
8
+
9
+ Query experiment results grouped by experiment ID, returning counts of `needs-review`, `reviewed`, and `complete` items in a single query instead of fetching all results client-side.
10
+
11
+ ```ts
12
+ const summary = await storage.experiments.getReviewSummary();
13
+ // [{ experimentId: 'exp-1', needsReview: 3, reviewed: 5, complete: 2, total: 10 }, ...]
14
+ ```
15
+
16
+ - Updated dependencies [[`dc9fc19`](https://github.com/mastra-ai/mastra/commit/dc9fc19da4437f6b508cc355f346a8856746a76b), [`260fe12`](https://github.com/mastra-ai/mastra/commit/260fe1295fe7354e39d6def2775e0797a7a277f0)]:
17
+ - @mastra/core@1.18.0-alpha.1
18
+
3
19
  ## 1.7.3-alpha.1
4
20
 
5
21
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-libsql
3
3
  description: Documentation for @mastra/libsql. Use when working with @mastra/libsql APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/libsql"
6
- version: "1.7.3-alpha.1"
6
+ version: "1.7.3-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.3-alpha.1",
2
+ "version": "1.7.3-alpha.2",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -4364,6 +4364,37 @@ var ExperimentsLibSQL = class extends storage.ExperimentsStorage {
4364
4364
  );
4365
4365
  }
4366
4366
  }
4367
+ async getReviewSummary() {
4368
+ try {
4369
+ const result = await this.#client.execute({
4370
+ sql: `SELECT
4371
+ "experimentId",
4372
+ COUNT(*) as total,
4373
+ SUM(CASE WHEN status = 'needs-review' THEN 1 ELSE 0 END) as "needsReview",
4374
+ SUM(CASE WHEN status = 'reviewed' THEN 1 ELSE 0 END) as reviewed,
4375
+ SUM(CASE WHEN status = 'complete' THEN 1 ELSE 0 END) as complete
4376
+ FROM ${storage.TABLE_EXPERIMENT_RESULTS}
4377
+ GROUP BY "experimentId"`,
4378
+ args: []
4379
+ });
4380
+ return (result.rows ?? []).map((row) => ({
4381
+ experimentId: row.experimentId,
4382
+ total: Number(row.total ?? 0),
4383
+ needsReview: Number(row.needsReview ?? 0),
4384
+ reviewed: Number(row.reviewed ?? 0),
4385
+ complete: Number(row.complete ?? 0)
4386
+ }));
4387
+ } catch (error$1) {
4388
+ throw new error.MastraError(
4389
+ {
4390
+ id: storage.createStorageErrorId("LIBSQL", "GET_REVIEW_SUMMARY", "FAILED"),
4391
+ domain: error.ErrorDomain.STORAGE,
4392
+ category: error.ErrorCategory.THIRD_PARTY
4393
+ },
4394
+ error$1
4395
+ );
4396
+ }
4397
+ }
4367
4398
  };
4368
4399
  var MCPClientsLibSQL = class extends storage.MCPClientsStorage {
4369
4400
  #db;