@mastra/dynamodb 0.14.0 → 0.14.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.
- package/dist/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/score/index.d.ts +3 -2
- package/dist/storage/domains/score/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 +5 -5
- package/src/storage/domains/score/index.ts +7 -3
- package/src/storage/index.ts +10 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
1
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
4
4
|
import type { Service } from 'electrodb';
|
|
@@ -14,11 +14,12 @@ export declare class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
14
14
|
saveScore(score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>): Promise<{
|
|
15
15
|
score: ScoreRowData;
|
|
16
16
|
}>;
|
|
17
|
-
getScoresByScorerId({ scorerId, pagination, entityId, entityType, }: {
|
|
17
|
+
getScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
18
18
|
scorerId: string;
|
|
19
19
|
pagination: StoragePagination;
|
|
20
20
|
entityId?: string;
|
|
21
21
|
entityType?: string;
|
|
22
|
+
source?: ScoringSource;
|
|
22
23
|
}): Promise<{
|
|
23
24
|
pagination: PaginationInfo;
|
|
24
25
|
scores: ScoreRowData[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/score/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAA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U,GACX,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IA6C7D,mBAAmB,CAAC,EACxB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CA+CpE"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
2
|
import type { StorageThreadType, MastraMessageV2, MastraMessageV1 } from '@mastra/core/memory';
|
|
3
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
3
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
4
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
5
5
|
import type { EvalRow, StorageGetMessagesArg, WorkflowRun, WorkflowRuns, TABLE_NAMES, StorageGetTracesArg, PaginationInfo, StorageColumn, StoragePagination, StorageDomains, PaginationArgs, StorageResourceType, ThreadSortOptions } from '@mastra/core/storage';
|
|
6
6
|
import type { Trace } from '@mastra/core/telemetry';
|
|
@@ -209,8 +209,11 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
209
209
|
pagination: PaginationInfo;
|
|
210
210
|
scores: ScoreRowData[];
|
|
211
211
|
}>;
|
|
212
|
-
getScoresByScorerId({ scorerId
|
|
212
|
+
getScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
213
213
|
scorerId: string;
|
|
214
|
+
entityId?: string;
|
|
215
|
+
entityType?: string;
|
|
216
|
+
source?: ScoringSource;
|
|
214
217
|
pagination: StoragePagination;
|
|
215
218
|
}): Promise<{
|
|
216
219
|
pagination: PaginationInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE/F,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,OAAO,EACP,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE;QACZ,WAAW,EAAE,MAAM,CA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S,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAIjE,gBAAgB,CAAC,EACrB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,WAAW,GACxB,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAI7D,mBAAmB,CAAC,EACxB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,GACxB,EAAE;QACD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAQ7D,mBAAmB,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CAGpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/dynamodb",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "DynamoDB storage adapter for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"tsup": "^8.5.0",
|
|
41
41
|
"typescript": "^5.8.3",
|
|
42
42
|
"vitest": "^3.2.4",
|
|
43
|
-
"@internal/lint": "0.0.
|
|
44
|
-
"@internal/
|
|
45
|
-
"@mastra/core": "0.13.
|
|
46
|
-
"@internal/
|
|
43
|
+
"@internal/lint": "0.0.29",
|
|
44
|
+
"@internal/storage-test-utils": "0.0.25",
|
|
45
|
+
"@mastra/core": "0.13.2",
|
|
46
|
+
"@internal/types-builder": "0.0.4"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup --silent --config tsup.config.ts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';
|
|
2
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
2
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
3
3
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
5
5
|
import type { Service } from 'electrodb';
|
|
@@ -115,14 +115,14 @@ export class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
115
115
|
pagination,
|
|
116
116
|
entityId,
|
|
117
117
|
entityType,
|
|
118
|
+
source,
|
|
118
119
|
}: {
|
|
119
120
|
scorerId: string;
|
|
120
121
|
pagination: StoragePagination;
|
|
121
122
|
entityId?: string;
|
|
122
123
|
entityType?: string;
|
|
124
|
+
source?: ScoringSource;
|
|
123
125
|
}): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }> {
|
|
124
|
-
this.logger.debug('Getting scores by scorer ID', { scorerId, pagination, entityId, entityType });
|
|
125
|
-
|
|
126
126
|
try {
|
|
127
127
|
// Query scores by scorer ID using the GSI
|
|
128
128
|
const query = this.service.entities.score.query.byScorer({ entity: 'score', scorerId });
|
|
@@ -138,6 +138,9 @@ export class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
138
138
|
if (entityType) {
|
|
139
139
|
allScores = allScores.filter((score: ScoreRowData) => score.entityType === entityType);
|
|
140
140
|
}
|
|
141
|
+
if (source) {
|
|
142
|
+
allScores = allScores.filter((score: ScoreRowData) => score.source === source);
|
|
143
|
+
}
|
|
141
144
|
|
|
142
145
|
// Sort by createdAt DESC (newest first)
|
|
143
146
|
allScores.sort((a: ScoreRowData, b: ScoreRowData) => b.createdAt.getTime() - a.createdAt.getTime());
|
|
@@ -170,6 +173,7 @@ export class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
170
173
|
scorerId: scorerId || '',
|
|
171
174
|
entityId: entityId || '',
|
|
172
175
|
entityType: entityType || '',
|
|
176
|
+
source: source || '',
|
|
173
177
|
page: pagination.page,
|
|
174
178
|
perPage: pagination.perPage,
|
|
175
179
|
},
|
package/src/storage/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
|
4
4
|
import { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';
|
|
5
5
|
import type { StorageThreadType, MastraMessageV2, MastraMessageV1 } from '@mastra/core/memory';
|
|
6
6
|
|
|
7
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
7
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
8
8
|
import { MastraStorage } from '@mastra/core/storage';
|
|
9
9
|
import type {
|
|
10
10
|
EvalRow,
|
|
@@ -475,12 +475,18 @@ export class DynamoDBStore extends MastraStorage {
|
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
async getScoresByScorerId({
|
|
478
|
-
scorerId
|
|
479
|
-
|
|
478
|
+
scorerId,
|
|
479
|
+
source,
|
|
480
|
+
entityId,
|
|
481
|
+
entityType,
|
|
482
|
+
pagination,
|
|
480
483
|
}: {
|
|
481
484
|
scorerId: string;
|
|
485
|
+
entityId?: string;
|
|
486
|
+
entityType?: string;
|
|
487
|
+
source?: ScoringSource;
|
|
482
488
|
pagination: StoragePagination;
|
|
483
489
|
}): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }> {
|
|
484
|
-
return this.stores.scores.getScoresByScorerId({ scorerId
|
|
490
|
+
return this.stores.scores.getScoresByScorerId({ scorerId, source, entityId, entityType, pagination });
|
|
485
491
|
}
|
|
486
492
|
}
|