@mastra/libsql 1.7.3-alpha.1 → 1.7.3-alpha.3
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 +25 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/datasets/index.d.ts.map +1 -1
- package/dist/storage/domains/experiments/index.d.ts +2 -1
- package/dist/storage/domains/experiments/index.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.7.3-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added `scorerIds` persistence for datasets. The `scorerIds` field is now stored and retrieved correctly when creating or updating datasets. ([#14783](https://github.com/mastra-ai/mastra/pull/14783))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`fbf22a7`](https://github.com/mastra-ai/mastra/commit/fbf22a7ad86bcb50dcf30459f0d075e51ddeb468), [`04160ee`](https://github.com/mastra-ai/mastra/commit/04160eedf3130003cf842ad08428c8ff69af4cc1), [`2c27503`](https://github.com/mastra-ai/mastra/commit/2c275032510d131d2cde47f99953abf0fe02c081), [`424a1df`](https://github.com/mastra-ai/mastra/commit/424a1df7bee59abb5c83717a54807fdd674a6224), [`12c88a6`](https://github.com/mastra-ai/mastra/commit/12c88a6e32bf982c2fe0c6af62e65a3414519a75), [`43595bf`](https://github.com/mastra-ai/mastra/commit/43595bf7b8df1a6edce7a23b445b5124d2a0b473), [`78670e9`](https://github.com/mastra-ai/mastra/commit/78670e97e76d7422cf7025faf371b2aeafed860d), [`d400e7c`](https://github.com/mastra-ai/mastra/commit/d400e7c8b8d7afa6ba2c71769eace4048e3cef8e), [`f58d1a7`](https://github.com/mastra-ai/mastra/commit/f58d1a7a457588a996c3ecb53201a68f3d28c432), [`a49a929`](https://github.com/mastra-ai/mastra/commit/a49a92904968b4fc67e01effee8c7c8d0464ba85)]:
|
|
10
|
+
- @mastra/core@1.18.0-alpha.4
|
|
11
|
+
|
|
12
|
+
## 1.7.3-alpha.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Add `getReviewSummary()` to experiments storage for aggregating review status counts ([#14649](https://github.com/mastra-ai/mastra/pull/14649))
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const summary = await storage.experiments.getReviewSummary();
|
|
22
|
+
// [{ experimentId: 'exp-1', needsReview: 3, reviewed: 5, complete: 2, total: 10 }, ...]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`dc9fc19`](https://github.com/mastra-ai/mastra/commit/dc9fc19da4437f6b508cc355f346a8856746a76b), [`260fe12`](https://github.com/mastra-ai/mastra/commit/260fe1295fe7354e39d6def2775e0797a7a277f0)]:
|
|
26
|
+
- @mastra/core@1.18.0-alpha.1
|
|
27
|
+
|
|
3
28
|
## 1.7.3-alpha.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2990,6 +2990,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
2990
2990
|
await this.#addColumnIfNotExists(storage.TABLE_DATASETS, "tags", "TEXT");
|
|
2991
2991
|
await this.#addColumnIfNotExists(storage.TABLE_DATASETS, "targetType", "TEXT");
|
|
2992
2992
|
await this.#addColumnIfNotExists(storage.TABLE_DATASETS, "targetIds", "TEXT");
|
|
2993
|
+
await this.#addColumnIfNotExists(storage.TABLE_DATASETS, "scorerIds", "TEXT");
|
|
2993
2994
|
await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "requestContext", "TEXT");
|
|
2994
2995
|
await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "source", "TEXT");
|
|
2995
2996
|
await this.#client.execute({
|
|
@@ -3037,6 +3038,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3037
3038
|
tags: row.tags ? storage.safelyParseJSON(row.tags) : void 0,
|
|
3038
3039
|
targetType: row.targetType || void 0,
|
|
3039
3040
|
targetIds: row.targetIds ? storage.safelyParseJSON(row.targetIds) : void 0,
|
|
3041
|
+
scorerIds: row.scorerIds ? storage.safelyParseJSON(row.scorerIds) : void 0,
|
|
3040
3042
|
version: row.version,
|
|
3041
3043
|
createdAt: storage.ensureDate(row.createdAt),
|
|
3042
3044
|
updatedAt: storage.ensureDate(row.updatedAt)
|
|
@@ -3098,6 +3100,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3098
3100
|
requestContextSchema: input.requestContextSchema ?? null,
|
|
3099
3101
|
targetType: input.targetType ?? null,
|
|
3100
3102
|
targetIds: input.targetIds ? JSON.stringify(input.targetIds) : null,
|
|
3103
|
+
scorerIds: input.scorerIds ? JSON.stringify(input.scorerIds) : null,
|
|
3101
3104
|
version: 0,
|
|
3102
3105
|
createdAt: nowIso,
|
|
3103
3106
|
updatedAt: nowIso
|
|
@@ -3113,6 +3116,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3113
3116
|
requestContextSchema: input.requestContextSchema ?? void 0,
|
|
3114
3117
|
targetType: input.targetType ?? void 0,
|
|
3115
3118
|
targetIds: input.targetIds ?? void 0,
|
|
3119
|
+
scorerIds: input.scorerIds ?? void 0,
|
|
3116
3120
|
version: 0,
|
|
3117
3121
|
createdAt: now,
|
|
3118
3122
|
updatedAt: now
|
|
@@ -3196,6 +3200,10 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3196
3200
|
updates.push("targetIds = ?");
|
|
3197
3201
|
values.push(args.targetIds === null ? null : JSON.stringify(args.targetIds));
|
|
3198
3202
|
}
|
|
3203
|
+
if (args.scorerIds !== void 0) {
|
|
3204
|
+
updates.push("scorerIds = ?");
|
|
3205
|
+
values.push(args.scorerIds === null ? null : JSON.stringify(args.scorerIds));
|
|
3206
|
+
}
|
|
3199
3207
|
values.push(args.id);
|
|
3200
3208
|
await this.#client.execute({
|
|
3201
3209
|
sql: `UPDATE ${storage.TABLE_DATASETS} SET ${updates.join(", ")} WHERE id = ?`,
|
|
@@ -3212,6 +3220,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3212
3220
|
tags: (args.tags !== void 0 ? args.tags : existing.tags) ?? void 0,
|
|
3213
3221
|
targetType: (args.targetType !== void 0 ? args.targetType : existing.targetType) ?? void 0,
|
|
3214
3222
|
targetIds: (args.targetIds !== void 0 ? args.targetIds : existing.targetIds) ?? void 0,
|
|
3223
|
+
scorerIds: (args.scorerIds !== void 0 ? args.scorerIds : existing.scorerIds) ?? void 0,
|
|
3215
3224
|
updatedAt: new Date(now)
|
|
3216
3225
|
};
|
|
3217
3226
|
} catch (error$1) {
|
|
@@ -4364,6 +4373,37 @@ var ExperimentsLibSQL = class extends storage.ExperimentsStorage {
|
|
|
4364
4373
|
);
|
|
4365
4374
|
}
|
|
4366
4375
|
}
|
|
4376
|
+
async getReviewSummary() {
|
|
4377
|
+
try {
|
|
4378
|
+
const result = await this.#client.execute({
|
|
4379
|
+
sql: `SELECT
|
|
4380
|
+
"experimentId",
|
|
4381
|
+
COUNT(*) as total,
|
|
4382
|
+
SUM(CASE WHEN status = 'needs-review' THEN 1 ELSE 0 END) as "needsReview",
|
|
4383
|
+
SUM(CASE WHEN status = 'reviewed' THEN 1 ELSE 0 END) as reviewed,
|
|
4384
|
+
SUM(CASE WHEN status = 'complete' THEN 1 ELSE 0 END) as complete
|
|
4385
|
+
FROM ${storage.TABLE_EXPERIMENT_RESULTS}
|
|
4386
|
+
GROUP BY "experimentId"`,
|
|
4387
|
+
args: []
|
|
4388
|
+
});
|
|
4389
|
+
return (result.rows ?? []).map((row) => ({
|
|
4390
|
+
experimentId: row.experimentId,
|
|
4391
|
+
total: Number(row.total ?? 0),
|
|
4392
|
+
needsReview: Number(row.needsReview ?? 0),
|
|
4393
|
+
reviewed: Number(row.reviewed ?? 0),
|
|
4394
|
+
complete: Number(row.complete ?? 0)
|
|
4395
|
+
}));
|
|
4396
|
+
} catch (error$1) {
|
|
4397
|
+
throw new error.MastraError(
|
|
4398
|
+
{
|
|
4399
|
+
id: storage.createStorageErrorId("LIBSQL", "GET_REVIEW_SUMMARY", "FAILED"),
|
|
4400
|
+
domain: error.ErrorDomain.STORAGE,
|
|
4401
|
+
category: error.ErrorCategory.THIRD_PARTY
|
|
4402
|
+
},
|
|
4403
|
+
error$1
|
|
4404
|
+
);
|
|
4405
|
+
}
|
|
4406
|
+
}
|
|
4367
4407
|
};
|
|
4368
4408
|
var MCPClientsLibSQL = class extends storage.MCPClientsStorage {
|
|
4369
4409
|
#db;
|