@mastra/dynamodb 0.0.0-scorers-api-v2-20250801171841 → 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 +1605 -0
- 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 +474 -728
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +475 -729
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +15 -31
- 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 +22 -5
- package/dist/storage/domains/score/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +23 -11
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +73 -69
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +29 -16
- 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
- package/src/entities/eval.ts +0 -102
- package/src/entities/index.ts +0 -27
- package/src/entities/message.ts +0 -143
- package/src/entities/resource.ts +0 -57
- package/src/entities/score.ts +0 -317
- package/src/entities/thread.ts +0 -66
- package/src/entities/trace.ts +0 -129
- package/src/entities/utils.ts +0 -51
- package/src/entities/workflow-snapshot.ts +0 -56
- package/src/index.ts +0 -1
- package/src/storage/docker-compose.yml +0 -16
- package/src/storage/domains/legacy-evals/index.ts +0 -243
- package/src/storage/domains/memory/index.ts +0 -894
- package/src/storage/domains/operations/index.ts +0 -433
- package/src/storage/domains/score/index.ts +0 -288
- package/src/storage/domains/traces/index.ts +0 -286
- package/src/storage/domains/workflows/index.ts +0 -297
- package/src/storage/index.test.ts +0 -1420
- package/src/storage/index.ts +0 -483
|
@@ -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;
|
|
@@ -9,12 +9,10 @@ export declare class MemoryStorageDynamoDB extends MemoryStorage {
|
|
|
9
9
|
service: Service<Record<string, any>>;
|
|
10
10
|
});
|
|
11
11
|
private parseMessageData;
|
|
12
|
+
private transformAndSortThreads;
|
|
12
13
|
getThreadById({ threadId }: {
|
|
13
14
|
threadId: string;
|
|
14
15
|
}): Promise<StorageThreadType | null>;
|
|
15
|
-
getThreadsByResourceId({ resourceId }: {
|
|
16
|
-
resourceId: string;
|
|
17
|
-
}): Promise<StorageThreadType[]>;
|
|
18
16
|
saveThread({ thread }: {
|
|
19
17
|
thread: StorageThreadType;
|
|
20
18
|
}): Promise<StorageThreadType>;
|
|
@@ -26,42 +24,28 @@ export declare class MemoryStorageDynamoDB extends MemoryStorage {
|
|
|
26
24
|
deleteThread({ threadId }: {
|
|
27
25
|
threadId: string;
|
|
28
26
|
}): Promise<void>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}): Promise<
|
|
32
|
-
|
|
33
|
-
format: 'v2';
|
|
34
|
-
}): Promise<MastraMessageV2[]>;
|
|
35
|
-
saveMessages(args: {
|
|
36
|
-
messages: MastraMessageV1[];
|
|
37
|
-
format?: undefined | 'v1';
|
|
38
|
-
}): Promise<MastraMessageV1[]>;
|
|
39
|
-
saveMessages(args: {
|
|
40
|
-
messages: MastraMessageV2[];
|
|
41
|
-
format: 'v2';
|
|
42
|
-
}): Promise<MastraMessageV2[]>;
|
|
43
|
-
getThreadsByResourceIdPaginated(args: {
|
|
44
|
-
resourceId: string;
|
|
45
|
-
page?: number;
|
|
46
|
-
perPage?: number;
|
|
47
|
-
}): Promise<PaginationInfo & {
|
|
48
|
-
threads: StorageThreadType[];
|
|
27
|
+
listMessagesById({ messageIds }: {
|
|
28
|
+
messageIds: string[];
|
|
29
|
+
}): Promise<{
|
|
30
|
+
messages: MastraDBMessage[];
|
|
49
31
|
}>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
33
|
+
saveMessages(args: {
|
|
34
|
+
messages: MastraDBMessage[];
|
|
35
|
+
}): Promise<{
|
|
36
|
+
messages: MastraDBMessage[];
|
|
54
37
|
}>;
|
|
38
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
55
39
|
private _getIncludedMessages;
|
|
56
40
|
updateMessages(args: {
|
|
57
|
-
messages: Partial<Omit<
|
|
41
|
+
messages: Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
58
42
|
id: string;
|
|
59
43
|
content?: {
|
|
60
44
|
metadata?: MastraMessageContentV2['metadata'];
|
|
61
45
|
content?: MastraMessageContentV2['content'];
|
|
62
46
|
};
|
|
63
47
|
}[];
|
|
64
|
-
}): Promise<
|
|
48
|
+
}): Promise<MastraDBMessage[]>;
|
|
65
49
|
getResourceById({ resourceId }: {
|
|
66
50
|
resourceId: string;
|
|
67
51
|
}): Promise<StorageResourceType | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],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AAa,EACb,QAAQ,GACT,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA2DjC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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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+
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,30 +7,39 @@ 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;
|
|
21
29
|
entityType?: string;
|
|
30
|
+
source?: ScoringSource;
|
|
22
31
|
}): Promise<{
|
|
23
32
|
pagination: PaginationInfo;
|
|
24
33
|
scores: ScoreRowData[];
|
|
25
34
|
}>;
|
|
26
|
-
|
|
35
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
27
36
|
runId: string;
|
|
28
37
|
pagination: StoragePagination;
|
|
29
38
|
}): Promise<{
|
|
30
39
|
pagination: PaginationInfo;
|
|
31
40
|
scores: ScoreRowData[];
|
|
32
41
|
}>;
|
|
33
|
-
|
|
42
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
34
43
|
entityId: string;
|
|
35
44
|
entityType: string;
|
|
36
45
|
pagination: StoragePagination;
|
|
@@ -38,5 +47,13 @@ export declare class ScoresStorageDynamoDB extends ScoresStorage {
|
|
|
38
47
|
pagination: PaginationInfo;
|
|
39
48
|
scores: ScoreRowData[];
|
|
40
49
|
}>;
|
|
50
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
51
|
+
traceId: string;
|
|
52
|
+
spanId: string;
|
|
53
|
+
pagination: StoragePagination;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
pagination: PaginationInfo;
|
|
56
|
+
scores: ScoreRowData[];
|
|
57
|
+
}>;
|
|
41
58
|
}
|
|
42
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,MAAM,
|
|
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;IAs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C/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CA4CpE"}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
|
-
import type { WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
3
|
-
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
2
|
+
import type { WorkflowRun, WorkflowRuns, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
3
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
4
|
import type { Service } from 'electrodb';
|
|
5
5
|
export declare class WorkflowStorageDynamoDB extends WorkflowsStorage {
|
|
6
6
|
private service;
|
|
7
7
|
constructor({ service }: {
|
|
8
8
|
service: Service<Record<string, any>>;
|
|
9
9
|
});
|
|
10
|
-
|
|
10
|
+
updateWorkflowResults({}: {
|
|
11
11
|
workflowName: string;
|
|
12
12
|
runId: string;
|
|
13
|
+
stepId: string;
|
|
14
|
+
result: StepResult<any, any, any, any>;
|
|
15
|
+
requestContext: Record<string, any>;
|
|
16
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
17
|
+
updateWorkflowState({}: {
|
|
18
|
+
workflowName: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
opts: {
|
|
21
|
+
status: string;
|
|
22
|
+
result?: StepResult<any, any, any, any>;
|
|
23
|
+
error?: string;
|
|
24
|
+
suspendedPaths?: Record<string, number[]>;
|
|
25
|
+
waitingPaths?: Record<string, number[]>;
|
|
26
|
+
};
|
|
27
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
28
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
29
|
+
workflowName: string;
|
|
30
|
+
runId: string;
|
|
31
|
+
resourceId?: string;
|
|
13
32
|
snapshot: WorkflowRunState;
|
|
14
33
|
}): Promise<void>;
|
|
15
34
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
16
35
|
workflowName: string;
|
|
17
36
|
runId: string;
|
|
18
37
|
}): Promise<WorkflowRunState | null>;
|
|
19
|
-
|
|
20
|
-
workflowName?: string;
|
|
21
|
-
fromDate?: Date;
|
|
22
|
-
toDate?: Date;
|
|
23
|
-
limit?: number;
|
|
24
|
-
offset?: number;
|
|
25
|
-
resourceId?: string;
|
|
26
|
-
}): Promise<WorkflowRuns>;
|
|
38
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
27
39
|
getWorkflowRunById(args: {
|
|
28
40
|
runId: string;
|
|
29
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;AACpG,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBzC,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC3D,OAAO,CAAC,OAAO,CAA+B;gBAClC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;KAAE;IAMlE,qBAAqB,CACnB,EAMC,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC,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,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 {
|
|
7
|
-
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
5
|
+
import type { WorkflowRun, WorkflowRuns, TABLE_NAMES, PaginationInfo, StorageColumn, StoragePagination, StorageDomains, StorageResourceType, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
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({ resourceId }: {
|
|
82
|
-
resourceId: string;
|
|
83
|
-
}): Promise<StorageThreadType[]>;
|
|
84
102
|
saveThread({ thread }: {
|
|
85
103
|
thread: StorageThreadType;
|
|
86
104
|
}): Promise<StorageThreadType>;
|
|
@@ -92,72 +110,54 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
92
110
|
deleteThread({ threadId }: {
|
|
93
111
|
threadId: string;
|
|
94
112
|
}): Promise<void>;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}): Promise<
|
|
98
|
-
|
|
99
|
-
format: 'v2';
|
|
100
|
-
}): Promise<MastraMessageV2[]>;
|
|
101
|
-
saveMessages(args: {
|
|
102
|
-
messages: MastraMessageV1[];
|
|
103
|
-
format?: undefined | 'v1';
|
|
104
|
-
}): Promise<MastraMessageV1[]>;
|
|
105
|
-
saveMessages(args: {
|
|
106
|
-
messages: MastraMessageV2[];
|
|
107
|
-
format: 'v2';
|
|
108
|
-
}): Promise<MastraMessageV2[]>;
|
|
109
|
-
getThreadsByResourceIdPaginated(args: {
|
|
110
|
-
resourceId: string;
|
|
111
|
-
page: number;
|
|
112
|
-
perPage: number;
|
|
113
|
-
}): Promise<PaginationInfo & {
|
|
114
|
-
threads: StorageThreadType[];
|
|
113
|
+
listMessagesById(args: {
|
|
114
|
+
messageIds: string[];
|
|
115
|
+
}): Promise<{
|
|
116
|
+
messages: MastraDBMessage[];
|
|
115
117
|
}>;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}): Promise<
|
|
119
|
-
messages:
|
|
118
|
+
saveMessages(args: {
|
|
119
|
+
messages: MastraDBMessage[];
|
|
120
|
+
}): Promise<{
|
|
121
|
+
messages: MastraDBMessage[];
|
|
120
122
|
}>;
|
|
121
123
|
updateMessages(_args: {
|
|
122
|
-
messages: Partial<Omit<
|
|
124
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
123
125
|
id: string;
|
|
124
126
|
content?: {
|
|
125
127
|
metadata?: MastraMessageContentV2['metadata'];
|
|
126
128
|
content?: MastraMessageContentV2['content'];
|
|
127
129
|
};
|
|
128
|
-
}[];
|
|
129
|
-
}): Promise<
|
|
130
|
-
|
|
131
|
-
name?: string;
|
|
132
|
-
scope?: string;
|
|
133
|
-
page: number;
|
|
134
|
-
perPage: number;
|
|
135
|
-
attributes?: Record<string, string>;
|
|
136
|
-
filters?: Record<string, any>;
|
|
137
|
-
}): Promise<any[]>;
|
|
138
|
-
batchTraceInsert({ records }: {
|
|
139
|
-
records: Record<string, any>[];
|
|
140
|
-
}): Promise<void>;
|
|
141
|
-
getTracesPaginated(_args: StorageGetTracesArg): Promise<PaginationInfo & {
|
|
142
|
-
traces: Trace[];
|
|
143
|
-
}>;
|
|
144
|
-
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
130
|
+
})[];
|
|
131
|
+
}): Promise<MastraDBMessage[]>;
|
|
132
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
145
133
|
workflowName: string;
|
|
146
134
|
runId: string;
|
|
135
|
+
stepId: string;
|
|
136
|
+
result: StepResult<any, any, any, any>;
|
|
137
|
+
requestContext: Record<string, any>;
|
|
138
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
139
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
140
|
+
workflowName: string;
|
|
141
|
+
runId: string;
|
|
142
|
+
opts: {
|
|
143
|
+
status: string;
|
|
144
|
+
result?: StepResult<any, any, any, any>;
|
|
145
|
+
error?: string;
|
|
146
|
+
suspendedPaths?: Record<string, number[]>;
|
|
147
|
+
waitingPaths?: Record<string, number[]>;
|
|
148
|
+
};
|
|
149
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
150
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
151
|
+
workflowName: string;
|
|
152
|
+
runId: string;
|
|
153
|
+
resourceId?: string;
|
|
147
154
|
snapshot: WorkflowRunState;
|
|
148
155
|
}): Promise<void>;
|
|
149
156
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
150
157
|
workflowName: string;
|
|
151
158
|
runId: string;
|
|
152
159
|
}): Promise<WorkflowRunState | null>;
|
|
153
|
-
|
|
154
|
-
workflowName?: string;
|
|
155
|
-
fromDate?: Date;
|
|
156
|
-
toDate?: Date;
|
|
157
|
-
limit?: number;
|
|
158
|
-
offset?: number;
|
|
159
|
-
resourceId?: string;
|
|
160
|
-
}): Promise<WorkflowRuns>;
|
|
160
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
161
161
|
getWorkflowRunById(args: {
|
|
162
162
|
runId: string;
|
|
163
163
|
workflowName?: string;
|
|
@@ -173,13 +173,6 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
173
173
|
workingMemory?: string;
|
|
174
174
|
metadata?: Record<string, any>;
|
|
175
175
|
}): Promise<StorageResourceType>;
|
|
176
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
177
|
-
getEvals(options: {
|
|
178
|
-
agentName?: string;
|
|
179
|
-
type?: 'test' | 'live';
|
|
180
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
181
|
-
evals: EvalRow[];
|
|
182
|
-
}>;
|
|
183
176
|
/**
|
|
184
177
|
* Closes the DynamoDB client connection and cleans up resources.
|
|
185
178
|
* Should be called when the store is no longer needed, e.g., at the end of tests or application shutdown.
|
|
@@ -191,17 +184,17 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
191
184
|
getScoreById({ id: _id }: {
|
|
192
185
|
id: string;
|
|
193
186
|
}): Promise<ScoreRowData | null>;
|
|
194
|
-
saveScore(
|
|
187
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
195
188
|
score: ScoreRowData;
|
|
196
189
|
}>;
|
|
197
|
-
|
|
190
|
+
listScoresByRunId({ runId: _runId, pagination: _pagination, }: {
|
|
198
191
|
runId: string;
|
|
199
192
|
pagination: StoragePagination;
|
|
200
193
|
}): Promise<{
|
|
201
194
|
pagination: PaginationInfo;
|
|
202
195
|
scores: ScoreRowData[];
|
|
203
196
|
}>;
|
|
204
|
-
|
|
197
|
+
listScoresByEntityId({ entityId: _entityId, entityType: _entityType, pagination: _pagination, }: {
|
|
205
198
|
pagination: StoragePagination;
|
|
206
199
|
entityId: string;
|
|
207
200
|
entityType: string;
|
|
@@ -209,8 +202,19 @@ export declare class DynamoDBStore extends MastraStorage {
|
|
|
209
202
|
pagination: PaginationInfo;
|
|
210
203
|
scores: ScoreRowData[];
|
|
211
204
|
}>;
|
|
212
|
-
|
|
205
|
+
listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
213
206
|
scorerId: string;
|
|
207
|
+
entityId?: string;
|
|
208
|
+
entityType?: string;
|
|
209
|
+
source?: ScoringSource;
|
|
210
|
+
pagination: StoragePagination;
|
|
211
|
+
}): Promise<{
|
|
212
|
+
pagination: PaginationInfo;
|
|
213
|
+
scores: ScoreRowData[];
|
|
214
|
+
}>;
|
|
215
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
216
|
+
traceId: string;
|
|
217
|
+
spanId: string;
|
|
214
218
|
pagination: StoragePagination;
|
|
215
219
|
}): Promise<{
|
|
216
220
|
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,
|
|
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,WAAW,EACX,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQ3E,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC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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",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"require": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.cjs"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
@@ -20,29 +20,42 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
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
|
-
"@
|
|
45
|
-
"@internal/storage-test-utils": "0.0.
|
|
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
|
+
},
|
|
48
|
+
"homepage": "https://mastra.ai",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
52
|
+
"directory": "stores/dynamodb"
|
|
53
|
+
},
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=22.13.0"
|
|
46
59
|
},
|
|
47
60
|
"scripts": {
|
|
48
61
|
"build": "tsup --silent --config tsup.config.ts",
|
|
@@ -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';
|
|
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
|
-
}
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{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