@mastra/dynamodb 0.0.0-scorers-ui-refactored-20250916094952 → 0.0.0-scorers-logs-20251208093427
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 +722 -3
- package/README.md +0 -4
- package/dist/entities/index.d.ts +20 -1
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/score.d.ts +20 -1
- package/dist/entities/score.d.ts.map +1 -1
- package/dist/index.cjs +410 -768
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +411 -769
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +13 -41
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/score/index.d.ts +21 -5
- package/dist/storage/domains/score/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +3 -10
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +50 -76
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +18 -15
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -19
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -28
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
|
-
import type { StorageThreadType,
|
|
2
|
+
import type { StorageThreadType, MastraDBMessage } from '@mastra/core/memory';
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
|
-
import type {
|
|
4
|
+
import type { StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput } from '@mastra/core/storage';
|
|
5
5
|
import type { Service } from 'electrodb';
|
|
6
6
|
export declare class MemoryStorageDynamoDB extends MemoryStorage {
|
|
7
7
|
private service;
|
|
@@ -13,12 +13,6 @@ export declare class MemoryStorageDynamoDB extends MemoryStorage {
|
|
|
13
13
|
getThreadById({ threadId }: {
|
|
14
14
|
threadId: string;
|
|
15
15
|
}): Promise<StorageThreadType | null>;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated use getThreadsByResourceIdPaginated instead for paginated results.
|
|
18
|
-
*/
|
|
19
|
-
getThreadsByResourceId(args: {
|
|
20
|
-
resourceId: string;
|
|
21
|
-
} & ThreadSortOptions): Promise<StorageThreadType[]>;
|
|
22
16
|
saveThread({ thread }: {
|
|
23
17
|
thread: StorageThreadType;
|
|
24
18
|
}): Promise<StorageThreadType>;
|
|
@@ -30,50 +24,28 @@ export declare class MemoryStorageDynamoDB extends MemoryStorage {
|
|
|
30
24
|
deleteThread({ threadId }: {
|
|
31
25
|
threadId: string;
|
|
32
26
|
}): Promise<void>;
|
|
33
|
-
|
|
34
|
-
format?: 'v1';
|
|
35
|
-
}): Promise<MastraMessageV1[]>;
|
|
36
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
37
|
-
format: 'v2';
|
|
38
|
-
}): Promise<MastraMessageV2[]>;
|
|
39
|
-
getMessagesById({ messageIds, format, }: {
|
|
40
|
-
messageIds: string[];
|
|
41
|
-
format: 'v1';
|
|
42
|
-
}): Promise<MastraMessageV1[]>;
|
|
43
|
-
getMessagesById({ messageIds, format, }: {
|
|
27
|
+
listMessagesById({ messageIds }: {
|
|
44
28
|
messageIds: string[];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
saveMessages(args: {
|
|
48
|
-
messages: MastraMessageV1[];
|
|
49
|
-
format?: undefined | 'v1';
|
|
50
|
-
}): Promise<MastraMessageV1[]>;
|
|
51
|
-
saveMessages(args: {
|
|
52
|
-
messages: MastraMessageV2[];
|
|
53
|
-
format: 'v2';
|
|
54
|
-
}): Promise<MastraMessageV2[]>;
|
|
55
|
-
getThreadsByResourceIdPaginated(args: {
|
|
56
|
-
resourceId: string;
|
|
57
|
-
page?: number;
|
|
58
|
-
perPage?: number;
|
|
59
|
-
} & ThreadSortOptions): Promise<PaginationInfo & {
|
|
60
|
-
threads: StorageThreadType[];
|
|
29
|
+
}): Promise<{
|
|
30
|
+
messages: MastraDBMessage[];
|
|
61
31
|
}>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
32
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
33
|
+
saveMessages(args: {
|
|
34
|
+
messages: MastraDBMessage[];
|
|
35
|
+
}): Promise<{
|
|
36
|
+
messages: MastraDBMessage[];
|
|
66
37
|
}>;
|
|
38
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
67
39
|
private _getIncludedMessages;
|
|
68
40
|
updateMessages(args: {
|
|
69
|
-
messages: Partial<Omit<
|
|
41
|
+
messages: Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
70
42
|
id: string;
|
|
71
43
|
content?: {
|
|
72
44
|
metadata?: MastraMessageContentV2['metadata'];
|
|
73
45
|
content?: MastraMessageContentV2['content'];
|
|
74
46
|
};
|
|
75
47
|
}[];
|
|
76
|
-
}): Promise<
|
|
48
|
+
}): Promise<MastraDBMessage[]>;
|
|
77
49
|
getResourceById({ resourceId }: {
|
|
78
50
|
resourceId: string;
|
|
79
51
|
}): Promise<StorageResourceType | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,E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":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAEL,eAAe,EAQhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,uBAAwB,SAAQ,eAAe;IAC1D,MAAM,EAAE,sBAAsB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;gBAC1B,EACV,OAAO,EACP,SAAS,EACT,MAAM,GACP,EAAE;QACD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QACtC,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,sBAAsB,CAAC;KAChC;IAOK,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAI7B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAGhC,OAAO,CAAC,qBAAqB;IAc7B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;;;OAIG;YACW,mBAAmB;IA6BjC;;;;;;OAMG;IACG,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BlG,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BrG,UAAU,CAAC,KAAK,EAAE;QACtB,SAAS,EAAE,WAAW,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACtC,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjB;;OAEG;IACG,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAwG1E;;OAEG;IACG,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqDpH;;OAEG;IACG,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CA+ChH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/
|
|
1
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
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';
|
|
@@ -7,14 +7,22 @@ export declare class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
7
7
|
constructor({ service }: {
|
|
8
8
|
service: Service<Record<string, any>>;
|
|
9
9
|
});
|
|
10
|
+
/**
|
|
11
|
+
* DynamoDB-specific score row transformation.
|
|
12
|
+
*
|
|
13
|
+
* Note: This implementation does NOT use coreTransformScoreRow because:
|
|
14
|
+
* 1. ElectroDB already parses JSON fields via its entity getters
|
|
15
|
+
* 2. DynamoDB stores empty strings for null values (which need special handling)
|
|
16
|
+
* 3. 'entity' is a reserved ElectroDB key, so we use 'entityData' column
|
|
17
|
+
*/
|
|
10
18
|
private parseScoreData;
|
|
11
19
|
getScoreById({ id }: {
|
|
12
20
|
id: string;
|
|
13
21
|
}): Promise<ScoreRowData | null>;
|
|
14
|
-
saveScore(score:
|
|
22
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
15
23
|
score: ScoreRowData;
|
|
16
24
|
}>;
|
|
17
|
-
|
|
25
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
18
26
|
scorerId: string;
|
|
19
27
|
pagination: StoragePagination;
|
|
20
28
|
entityId?: string;
|
|
@@ -24,14 +32,14 @@ export declare class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
24
32
|
pagination: PaginationInfo;
|
|
25
33
|
scores: ScoreRowData[];
|
|
26
34
|
}>;
|
|
27
|
-
|
|
35
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
28
36
|
runId: string;
|
|
29
37
|
pagination: StoragePagination;
|
|
30
38
|
}): Promise<{
|
|
31
39
|
pagination: PaginationInfo;
|
|
32
40
|
scores: ScoreRowData[];
|
|
33
41
|
}>;
|
|
34
|
-
|
|
42
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
35
43
|
entityId: string;
|
|
36
44
|
entityType: string;
|
|
37
45
|
pagination: StoragePagination;
|
|
@@ -39,5 +47,13 @@ export declare class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
39
47
|
pagination: PaginationInfo;
|
|
40
48
|
scores: ScoreRowData[];
|
|
41
49
|
}>;
|
|
50
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
51
|
+
traceId: string;
|
|
52
|
+
spanId: string;
|
|
53
|
+
pagination: StoragePagination;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
pagination: PaginationInfo;
|
|
56
|
+
scores: ScoreRowData[];
|
|
57
|
+
}>;
|
|
42
58
|
}
|
|
43
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/score/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAEnH,OAAO,EAGL,aAAa,EAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,OAAO,CAAC,OAAO,CAA+B;gBAClC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;KAAE;IAKlE;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAsBhB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAuBlE,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IA2FpE,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IA6D7D,iBAAiB,CAAC,EACtB,KAAK,EACL,UAAU,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,oBAAoB,CAAC,EACzB,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;IAgD7D,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CA4CpE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
|
-
import type { WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
2
|
+
import type { WorkflowRun, WorkflowRuns, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
3
3
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
4
|
import type { Service } from 'electrodb';
|
|
5
5
|
export declare class WorkflowStorageDynamoDB extends WorkflowsStorage {
|
|
@@ -12,7 +12,7 @@ export declare class WorkflowStorageDynamoDB extends WorkflowsStorage {
|
|
|
12
12
|
runId: string;
|
|
13
13
|
stepId: string;
|
|
14
14
|
result: StepResult<any, any, any, any>;
|
|
15
|
-
|
|
15
|
+
requestContext: Record<string, any>;
|
|
16
16
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
17
17
|
updateWorkflowState({}: {
|
|
18
18
|
workflowName: string;
|
|
@@ -35,14 +35,7 @@ export declare class WorkflowStorageDynamoDB extends WorkflowsStorage {
|
|
|
35
35
|
workflowName: string;
|
|
36
36
|
runId: string;
|
|
37
37
|
}): Promise<WorkflowRunState | null>;
|
|
38
|
-
|
|
39
|
-
workflowName?: string;
|
|
40
|
-
fromDate?: Date;
|
|
41
|
-
toDate?: Date;
|
|
42
|
-
limit?: number;
|
|
43
|
-
offset?: number;
|
|
44
|
-
resourceId?: string;
|
|
45
|
-
}): Promise<WorkflowRuns>;
|
|
38
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
46
39
|
getWorkflowRunById(args: {
|
|
47
40
|
runId: string;
|
|
48
41
|
workflowName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC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,GACT,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BX,oBAAoB,CAAC,EACzB,YAAY,EACZ,KAAK,GACN,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAiC9B,gBAAgB,CAAC,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC;IAgH5E,kBAAkB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CA8EtG"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
3
|
+
import type { StorageThreadType, MastraDBMessage } from '@mastra/core/memory';
|
|
4
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
5
|
-
import type {
|
|
6
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
5
|
+
import type { WorkflowRun, WorkflowRuns, TABLE_NAMES, PaginationInfo, StorageColumn, StoragePagination, StorageDomains, StorageResourceType, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
7
6
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
8
7
|
export interface DynamoDBStoreConfig {
|
|
8
|
+
id: string;
|
|
9
9
|
region?: string;
|
|
10
10
|
tableName: string;
|
|
11
11
|
endpoint?: string;
|
|
@@ -13,6 +13,26 @@ export interface DynamoDBStoreConfig {
|
|
|
13
13
|
accessKeyId: string;
|
|
14
14
|
secretAccessKey: string;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* When true, automatic initialization (table creation/migrations) is disabled.
|
|
18
|
+
* This is useful for CI/CD pipelines where you want to:
|
|
19
|
+
* 1. Run migrations explicitly during deployment (not at runtime)
|
|
20
|
+
* 2. Use different credentials for schema changes vs runtime operations
|
|
21
|
+
*
|
|
22
|
+
* When disableInit is true:
|
|
23
|
+
* - The storage will not automatically create/alter tables on first use
|
|
24
|
+
* - You must call `storage.init()` explicitly in your CI/CD scripts
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // In CI/CD script:
|
|
28
|
+
* const storage = new DynamoDBStore({ name: 'my-store', config: { ...config, disableInit: false } });
|
|
29
|
+
* await storage.init(); // Explicitly run migrations
|
|
30
|
+
*
|
|
31
|
+
* // In runtime application:
|
|
32
|
+
* const storage = new DynamoDBStore({ name: 'my-store', config: { ...config, disableInit: true } });
|
|
33
|
+
* // No auto-init, tables must already exist
|
|
34
|
+
*/
|
|
35
|
+
disableInit?: boolean;
|
|
16
36
|
}
|
|
17
37
|
export declare class DynamoDBStore extends MastraStorage {
|
|
18
38
|
private tableName;
|
|
@@ -30,6 +50,7 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
30
50
|
hasColumn: boolean;
|
|
31
51
|
createTable: boolean;
|
|
32
52
|
deleteMessages: boolean;
|
|
53
|
+
listScoresBySpan: boolean;
|
|
33
54
|
};
|
|
34
55
|
/**
|
|
35
56
|
* Validates that the required DynamoDB table exists and is accessible.
|
|
@@ -78,9 +99,6 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
78
99
|
getThreadById({ threadId }: {
|
|
79
100
|
threadId: string;
|
|
80
101
|
}): Promise<StorageThreadType | null>;
|
|
81
|
-
getThreadsByResourceId(args: {
|
|
82
|
-
resourceId: string;
|
|
83
|
-
} & ThreadSortOptions): Promise<StorageThreadType[]>;
|
|
84
102
|
saveThread({ thread }: {
|
|
85
103
|
thread: StorageThreadType;
|
|
86
104
|
}): Promise<StorageThreadType>;
|
|
@@ -92,69 +110,31 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
92
110
|
deleteThread({ threadId }: {
|
|
93
111
|
threadId: string;
|
|
94
112
|
}): Promise<void>;
|
|
95
|
-
|
|
96
|
-
format?: 'v1';
|
|
97
|
-
}): Promise<MastraMessageV1[]>;
|
|
98
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
99
|
-
format: 'v2';
|
|
100
|
-
}): Promise<MastraMessageV2[]>;
|
|
101
|
-
getMessagesById({ messageIds, format }: {
|
|
113
|
+
listMessagesById(args: {
|
|
102
114
|
messageIds: string[];
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
getMessagesById({ messageIds, format }: {
|
|
106
|
-
messageIds: string[];
|
|
107
|
-
format?: 'v2';
|
|
108
|
-
}): Promise<MastraMessageV2[]>;
|
|
109
|
-
saveMessages(args: {
|
|
110
|
-
messages: MastraMessageV1[];
|
|
111
|
-
format?: undefined | 'v1';
|
|
112
|
-
}): Promise<MastraMessageV1[]>;
|
|
113
|
-
saveMessages(args: {
|
|
114
|
-
messages: MastraMessageV2[];
|
|
115
|
-
format: 'v2';
|
|
116
|
-
}): Promise<MastraMessageV2[]>;
|
|
117
|
-
getThreadsByResourceIdPaginated(args: {
|
|
118
|
-
resourceId: string;
|
|
119
|
-
page: number;
|
|
120
|
-
perPage: number;
|
|
121
|
-
} & ThreadSortOptions): Promise<PaginationInfo & {
|
|
122
|
-
threads: StorageThreadType[];
|
|
115
|
+
}): Promise<{
|
|
116
|
+
messages: MastraDBMessage[];
|
|
123
117
|
}>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}): Promise<
|
|
127
|
-
messages:
|
|
118
|
+
saveMessages(args: {
|
|
119
|
+
messages: MastraDBMessage[];
|
|
120
|
+
}): Promise<{
|
|
121
|
+
messages: MastraDBMessage[];
|
|
128
122
|
}>;
|
|
129
123
|
updateMessages(_args: {
|
|
130
|
-
messages: Partial<Omit<
|
|
124
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
131
125
|
id: string;
|
|
132
126
|
content?: {
|
|
133
127
|
metadata?: MastraMessageContentV2['metadata'];
|
|
134
128
|
content?: MastraMessageContentV2['content'];
|
|
135
129
|
};
|
|
136
|
-
}[];
|
|
137
|
-
}): Promise<
|
|
138
|
-
|
|
139
|
-
name?: string;
|
|
140
|
-
scope?: string;
|
|
141
|
-
page: number;
|
|
142
|
-
perPage: number;
|
|
143
|
-
attributes?: Record<string, string>;
|
|
144
|
-
filters?: Record<string, any>;
|
|
145
|
-
}): Promise<any[]>;
|
|
146
|
-
batchTraceInsert({ records }: {
|
|
147
|
-
records: Record<string, any>[];
|
|
148
|
-
}): Promise<void>;
|
|
149
|
-
getTracesPaginated(_args: StorageGetTracesArg): Promise<PaginationInfo & {
|
|
150
|
-
traces: Trace[];
|
|
151
|
-
}>;
|
|
152
|
-
updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext, }: {
|
|
130
|
+
})[];
|
|
131
|
+
}): Promise<MastraDBMessage[]>;
|
|
132
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
153
133
|
workflowName: string;
|
|
154
134
|
runId: string;
|
|
155
135
|
stepId: string;
|
|
156
136
|
result: StepResult<any, any, any, any>;
|
|
157
|
-
|
|
137
|
+
requestContext: Record<string, any>;
|
|
158
138
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
159
139
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
160
140
|
workflowName: string;
|
|
@@ -177,14 +157,7 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
177
157
|
workflowName: string;
|
|
178
158
|
runId: string;
|
|
179
159
|
}): Promise<WorkflowRunState | null>;
|
|
180
|
-
|
|
181
|
-
workflowName?: string;
|
|
182
|
-
fromDate?: Date;
|
|
183
|
-
toDate?: Date;
|
|
184
|
-
limit?: number;
|
|
185
|
-
offset?: number;
|
|
186
|
-
resourceId?: string;
|
|
187
|
-
}): Promise<WorkflowRuns>;
|
|
160
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
188
161
|
getWorkflowRunById(args: {
|
|
189
162
|
runId: string;
|
|
190
163
|
workflowName?: string;
|
|
@@ -200,13 +173,6 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
200
173
|
workingMemory?: string;
|
|
201
174
|
metadata?: Record<string, any>;
|
|
202
175
|
}): Promise<StorageResourceType>;
|
|
203
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
204
|
-
getEvals(options: {
|
|
205
|
-
agentName?: string;
|
|
206
|
-
type?: 'test' | 'live';
|
|
207
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
208
|
-
evals: EvalRow[];
|
|
209
|
-
}>;
|
|
210
176
|
/**
|
|
211
177
|
* Closes the DynamoDB client connection and cleans up resources.
|
|
212
178
|
* Should be called when the store is no longer needed, e.g., at the end of tests or application shutdown.
|
|
@@ -218,17 +184,17 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
218
184
|
getScoreById({ id: _id }: {
|
|
219
185
|
id: string;
|
|
220
186
|
}): Promise<ScoreRowData | null>;
|
|
221
|
-
saveScore(
|
|
187
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
222
188
|
score: ScoreRowData;
|
|
223
189
|
}>;
|
|
224
|
-
|
|
190
|
+
listScoresByRunId({ runId: _runId, pagination: _pagination, }: {
|
|
225
191
|
runId: string;
|
|
226
192
|
pagination: StoragePagination;
|
|
227
193
|
}): Promise<{
|
|
228
194
|
pagination: PaginationInfo;
|
|
229
195
|
scores: ScoreRowData[];
|
|
230
196
|
}>;
|
|
231
|
-
|
|
197
|
+
listScoresByEntityId({ entityId: _entityId, entityType: _entityType, pagination: _pagination, }: {
|
|
232
198
|
pagination: StoragePagination;
|
|
233
199
|
entityId: string;
|
|
234
200
|
entityType: string;
|
|
@@ -236,7 +202,7 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
236
202
|
pagination: PaginationInfo;
|
|
237
203
|
scores: ScoreRowData[];
|
|
238
204
|
}>;
|
|
239
|
-
|
|
205
|
+
listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
240
206
|
scorerId: string;
|
|
241
207
|
entityId?: string;
|
|
242
208
|
entityType?: string;
|
|
@@ -246,5 +212,13 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
246
212
|
pagination: PaginationInfo;
|
|
247
213
|
scores: ScoreRowData[];
|
|
248
214
|
}>;
|
|
215
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
216
|
+
traceId: string;
|
|
217
|
+
spanId: string;
|
|
218
|
+
pagination: StoragePagination;
|
|
219
|
+
}): Promise<{
|
|
220
|
+
pagination: PaginationInfo;
|
|
221
|
+
scores: ScoreRowData[];
|
|
222
|
+
}>;
|
|
249
223
|
}
|
|
250
224
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,
|
|
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,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAwB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EACV,WA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BAAiB,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,oBAAoB,CAAC,EACzB,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;IAI7D,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,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.0.0-scorers-
|
|
3
|
+
"version": "0.0.0-scorers-logs-20251208093427",
|
|
4
4
|
"description": "DynamoDB storage adapter for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
"CHANGELOG.md"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
27
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
28
|
-
"electrodb": "^3.
|
|
26
|
+
"@aws-sdk/client-dynamodb": "^3.902.0",
|
|
27
|
+
"@aws-sdk/lib-dynamodb": "^3.902.0",
|
|
28
|
+
"electrodb": "^3.5.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@mastra/core": "0.0.0-scorers-
|
|
31
|
+
"@mastra/core": "0.0.0-scorers-logs-20251208093427"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-extractor": "^7.52.8",
|
|
35
|
-
"@types/node": "
|
|
36
|
-
"@vitest/coverage-v8": "
|
|
37
|
-
"@vitest/ui": "
|
|
38
|
-
"axios": "^1.
|
|
39
|
-
"eslint": "^9.
|
|
35
|
+
"@types/node": "22.13.17",
|
|
36
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
37
|
+
"@vitest/ui": "4.0.12",
|
|
38
|
+
"axios": "^1.12.2",
|
|
39
|
+
"eslint": "^9.37.0",
|
|
40
40
|
"tsup": "^8.5.0",
|
|
41
41
|
"typescript": "^5.8.3",
|
|
42
|
-
"vitest": "
|
|
43
|
-
"@internal/lint": "0.0.0-scorers-
|
|
44
|
-
"@internal/
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
42
|
+
"vitest": "4.0.12",
|
|
43
|
+
"@internal/lint": "0.0.0-scorers-logs-20251208093427",
|
|
44
|
+
"@internal/types-builder": "0.0.0-scorers-logs-20251208093427",
|
|
45
|
+
"@internal/storage-test-utils": "0.0.49",
|
|
46
|
+
"@mastra/core": "0.0.0-scorers-logs-20251208093427"
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://mastra.ai",
|
|
49
49
|
"repository": {
|
|
@@ -54,6 +54,9 @@
|
|
|
54
54
|
"bugs": {
|
|
55
55
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
56
56
|
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=22.13.0"
|
|
59
|
+
},
|
|
57
60
|
"scripts": {
|
|
58
61
|
"build": "tsup --silent --config tsup.config.ts",
|
|
59
62
|
"dev": "tsup --watch && tsc -p tsconfig.build.json",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { EvalRow, PaginationArgs, PaginationInfo } from '@mastra/core/storage';
|
|
2
|
-
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { Service } from 'electrodb';
|
|
4
|
-
export declare class LegacyEvalsDynamoDB extends LegacyEvalsStorage {
|
|
5
|
-
service: Service<Record<string, any>>;
|
|
6
|
-
tableName: string;
|
|
7
|
-
constructor({ service, tableName }: {
|
|
8
|
-
service: Service<Record<string, any>>;
|
|
9
|
-
tableName: string;
|
|
10
|
-
});
|
|
11
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
12
|
-
getEvals(options?: {
|
|
13
|
-
agentName?: string;
|
|
14
|
-
type?: 'test' | 'live';
|
|
15
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
16
|
-
evals: EvalRow[];
|
|
17
|
-
}>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/legacy-evals/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;gBAEN,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;IAO1F,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAqFlF,QAAQ,CACZ,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,GAAG,cAAmB,GACtB,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CAwIlD"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TracesStorage } from '@mastra/core/storage';
|
|
2
|
-
import type { PaginationInfo, StorageGetTracesPaginatedArg } from '@mastra/core/storage';
|
|
3
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
4
|
-
import type { Service } from 'electrodb';
|
|
5
|
-
import type { StoreOperationsDynamoDB } from '../operations/index.js';
|
|
6
|
-
export declare class TracesStorageDynamoDB extends TracesStorage {
|
|
7
|
-
private service;
|
|
8
|
-
private operations;
|
|
9
|
-
constructor({ service, operations }: {
|
|
10
|
-
service: Service<Record<string, any>>;
|
|
11
|
-
operations: StoreOperationsDynamoDB;
|
|
12
|
-
});
|
|
13
|
-
getTraces(args: {
|
|
14
|
-
name?: string;
|
|
15
|
-
scope?: string;
|
|
16
|
-
page: number;
|
|
17
|
-
perPage: number;
|
|
18
|
-
attributes?: Record<string, string>;
|
|
19
|
-
filters?: Record<string, any>;
|
|
20
|
-
}): Promise<any[]>;
|
|
21
|
-
batchTraceInsert({ records }: {
|
|
22
|
-
records: Record<string, any>[];
|
|
23
|
-
}): Promise<void>;
|
|
24
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
25
|
-
traces: Trace[];
|
|
26
|
-
}>;
|
|
27
|
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