@mastra/lance 0.2.4-alpha.0 → 0.2.5-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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/index.cjs +26 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +5 -2
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +5 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/storage/domains/scores/index.ts +29 -7
- package/src/storage/index.ts +8 -2
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @mastra/lance
|
|
2
2
|
|
|
3
|
+
## 0.2.5-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cc9035c: dependencies updates:
|
|
8
|
+
- Updated dependency [`@lancedb/lancedb@^0.21.2` ↗︎](https://www.npmjs.com/package/@lancedb/lancedb/v/0.21.2) (from `^0.18.2`, in `dependencies`)
|
|
9
|
+
- b32c50d: Filter scores by source
|
|
10
|
+
- Updated dependencies [d5330bf]
|
|
11
|
+
- Updated dependencies [a239d41]
|
|
12
|
+
- Updated dependencies [b32c50d]
|
|
13
|
+
- Updated dependencies [121a3f8]
|
|
14
|
+
- Updated dependencies [ec510e7]
|
|
15
|
+
- @mastra/core@0.13.2-alpha.2
|
|
16
|
+
|
|
17
|
+
## 0.2.4
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
22
|
+
- Updated dependencies [cb36de0]
|
|
23
|
+
- Updated dependencies [d0496e6]
|
|
24
|
+
- Updated dependencies [a82b851]
|
|
25
|
+
- Updated dependencies [ea0c5f2]
|
|
26
|
+
- Updated dependencies [41a0a0e]
|
|
27
|
+
- Updated dependencies [2871020]
|
|
28
|
+
- Updated dependencies [94f4812]
|
|
29
|
+
- Updated dependencies [e202b82]
|
|
30
|
+
- Updated dependencies [e00f6a0]
|
|
31
|
+
- Updated dependencies [4a406ec]
|
|
32
|
+
- Updated dependencies [b0e43c1]
|
|
33
|
+
- Updated dependencies [5d377e5]
|
|
34
|
+
- Updated dependencies [1fb812e]
|
|
35
|
+
- Updated dependencies [35c5798]
|
|
36
|
+
- @mastra/core@0.13.0
|
|
37
|
+
|
|
3
38
|
## 0.2.4-alpha.0
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1361,6 +1361,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
async saveScore(score) {
|
|
1363
1363
|
try {
|
|
1364
|
+
const id = crypto.randomUUID();
|
|
1364
1365
|
const table = await this.client.openTable(storage.TABLE_SCORERS);
|
|
1365
1366
|
const schema = await getTableSchema({ tableName: storage.TABLE_SCORERS, client: this.client });
|
|
1366
1367
|
const allowedFields = new Set(schema.fields.map((f) => f.name));
|
|
@@ -1375,7 +1376,7 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1375
1376
|
filteredScore[key] = JSON.stringify(filteredScore[key]);
|
|
1376
1377
|
}
|
|
1377
1378
|
}
|
|
1378
|
-
|
|
1379
|
+
filteredScore.id = id;
|
|
1379
1380
|
await table.add([filteredScore], { mode: "append" });
|
|
1380
1381
|
return { score };
|
|
1381
1382
|
} catch (error$1) {
|
|
@@ -1414,18 +1415,35 @@ var StoreScoresLance = class extends storage.ScoresStorage {
|
|
|
1414
1415
|
}
|
|
1415
1416
|
async getScoresByScorerId({
|
|
1416
1417
|
scorerId,
|
|
1417
|
-
pagination
|
|
1418
|
+
pagination,
|
|
1419
|
+
entityId,
|
|
1420
|
+
entityType,
|
|
1421
|
+
source
|
|
1418
1422
|
}) {
|
|
1419
1423
|
try {
|
|
1420
1424
|
const table = await this.client.openTable(storage.TABLE_SCORERS);
|
|
1421
1425
|
const { page = 0, perPage = 10 } = pagination || {};
|
|
1422
1426
|
const offset = page * perPage;
|
|
1423
|
-
|
|
1427
|
+
let query = table.query().where(`\`scorerId\` = '${scorerId}'`);
|
|
1428
|
+
if (source) {
|
|
1429
|
+
query = query.where(`\`source\` = '${source}'`);
|
|
1430
|
+
}
|
|
1431
|
+
if (entityId) {
|
|
1432
|
+
query = query.where(`\`entityId\` = '${entityId}'`);
|
|
1433
|
+
}
|
|
1434
|
+
if (entityType) {
|
|
1435
|
+
query = query.where(`\`entityType\` = '${entityType}'`);
|
|
1436
|
+
}
|
|
1437
|
+
query = query.limit(perPage);
|
|
1424
1438
|
if (offset > 0) query.offset(offset);
|
|
1425
1439
|
const records = await query.toArray();
|
|
1426
1440
|
const schema = await getTableSchema({ tableName: storage.TABLE_SCORERS, client: this.client });
|
|
1427
1441
|
const scores = processResultWithTypeConversion(records, schema);
|
|
1428
|
-
|
|
1442
|
+
let totalQuery = table.query().where(`\`scorerId\` = '${scorerId}'`);
|
|
1443
|
+
if (source) {
|
|
1444
|
+
totalQuery = totalQuery.where(`\`source\` = '${source}'`);
|
|
1445
|
+
}
|
|
1446
|
+
const allRecords = await totalQuery.toArray();
|
|
1429
1447
|
const total = allRecords.length;
|
|
1430
1448
|
return {
|
|
1431
1449
|
pagination: {
|
|
@@ -2122,9 +2140,12 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
|
|
|
2122
2140
|
}
|
|
2123
2141
|
async getScoresByScorerId({
|
|
2124
2142
|
scorerId,
|
|
2143
|
+
source,
|
|
2144
|
+
entityId,
|
|
2145
|
+
entityType,
|
|
2125
2146
|
pagination
|
|
2126
2147
|
}) {
|
|
2127
|
-
return this.stores.scores.getScoresByScorerId({ scorerId, pagination });
|
|
2148
|
+
return this.stores.scores.getScoresByScorerId({ scorerId, source, pagination, entityId, entityType });
|
|
2128
2149
|
}
|
|
2129
2150
|
async saveScore(_score) {
|
|
2130
2151
|
return this.stores.scores.saveScore(_score);
|