@mastra/upstash 0.15.8-alpha.0 → 1.0.0-beta.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/CHANGELOG.md +197 -10
- package/dist/index.cjs +272 -644
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +272 -644
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +14 -44
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +14 -45
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +4 -10
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +22 -91
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +4 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +8 -12
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -28
- 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 {
|
|
2
|
+
import type { MastraDBMessage, StorageThreadType } 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 { Redis } from '@upstash/redis';
|
|
6
6
|
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
7
7
|
export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
@@ -14,19 +14,7 @@ export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
|
14
14
|
getThreadById({ threadId }: {
|
|
15
15
|
threadId: string;
|
|
16
16
|
}): Promise<StorageThreadType | null>;
|
|
17
|
-
|
|
18
|
-
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
19
|
-
*/
|
|
20
|
-
getThreadsByResourceId({ resourceId }: {
|
|
21
|
-
resourceId: string;
|
|
22
|
-
}): Promise<StorageThreadType[]>;
|
|
23
|
-
getThreadsByResourceIdPaginated(args: {
|
|
24
|
-
resourceId: string;
|
|
25
|
-
page: number;
|
|
26
|
-
perPage: number;
|
|
27
|
-
}): Promise<PaginationInfo & {
|
|
28
|
-
threads: StorageThreadType[];
|
|
29
|
-
}>;
|
|
17
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
30
18
|
saveThread({ thread }: {
|
|
31
19
|
thread: StorageThreadType;
|
|
32
20
|
}): Promise<StorageThreadType>;
|
|
@@ -39,37 +27,18 @@ export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
|
39
27
|
threadId: string;
|
|
40
28
|
}): Promise<void>;
|
|
41
29
|
saveMessages(args: {
|
|
42
|
-
messages:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
messages: MastraMessageV2[];
|
|
47
|
-
format: 'v2';
|
|
48
|
-
}): Promise<MastraMessageV2[]>;
|
|
30
|
+
messages: MastraDBMessage[];
|
|
31
|
+
}): Promise<{
|
|
32
|
+
messages: MastraDBMessage[];
|
|
33
|
+
}>;
|
|
49
34
|
private _getIncludedMessages;
|
|
50
35
|
private parseStoredMessage;
|
|
51
|
-
|
|
52
|
-
* @deprecated use getMessagesPaginated instead
|
|
53
|
-
*/
|
|
54
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
55
|
-
format?: 'v1';
|
|
56
|
-
}): Promise<MastraMessageV1[]>;
|
|
57
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
58
|
-
format: 'v2';
|
|
59
|
-
}): Promise<MastraMessageV2[]>;
|
|
60
|
-
getMessagesById({ messageIds, format, }: {
|
|
61
|
-
messageIds: string[];
|
|
62
|
-
format: 'v1';
|
|
63
|
-
}): Promise<MastraMessageV1[]>;
|
|
64
|
-
getMessagesById({ messageIds, format, }: {
|
|
36
|
+
listMessagesById({ messageIds }: {
|
|
65
37
|
messageIds: string[];
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
69
|
-
format?: 'v1' | 'v2';
|
|
70
|
-
}): Promise<PaginationInfo & {
|
|
71
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
38
|
+
}): Promise<{
|
|
39
|
+
messages: MastraDBMessage[];
|
|
72
40
|
}>;
|
|
41
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
73
42
|
getResourceById({ resourceId }: {
|
|
74
43
|
resourceId: string;
|
|
75
44
|
}): Promise<StorageResourceType | null>;
|
|
@@ -82,14 +51,15 @@ export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
|
82
51
|
metadata?: Record<string, unknown>;
|
|
83
52
|
}): Promise<StorageResourceType>;
|
|
84
53
|
updateMessages(args: {
|
|
85
|
-
messages: (Partial<Omit<
|
|
54
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
86
55
|
id: string;
|
|
87
56
|
content?: {
|
|
88
57
|
metadata?: MastraMessageContentV2['metadata'];
|
|
89
58
|
content?: MastraMessageContentV2['content'];
|
|
90
59
|
};
|
|
91
60
|
})[];
|
|
92
|
-
}): Promise<
|
|
61
|
+
}): Promise<MastraDBMessage[]>;
|
|
93
62
|
deleteMessages(messageIds: string[]): Promise<void>;
|
|
63
|
+
private sortThreads;
|
|
94
64
|
}
|
|
95
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EA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AAE,EAAE,MAAM,CAAC;YACX,OAAO,CAAC,EAAE;gBAAE,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;gBAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAA;aAAE,CAAC;SAC1G,CAAC,EAAE,CAAC;KACN,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA6JxB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsEzD,OAAO,CAAC,WAAW;CAgBpB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/
|
|
1
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
|
+
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
3
4
|
import type { Redis } from '@upstash/redis';
|
|
4
5
|
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
6
|
export declare class ScoresUpstash extends ScoresStorage {
|
|
@@ -12,73 +13,41 @@ export declare class ScoresUpstash extends ScoresStorage {
|
|
|
12
13
|
getScoreById({ id }: {
|
|
13
14
|
id: string;
|
|
14
15
|
}): Promise<ScoreRowData | null>;
|
|
15
|
-
|
|
16
|
+
listScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
|
|
16
17
|
scorerId: string;
|
|
17
18
|
entityId?: string;
|
|
18
19
|
entityType?: string;
|
|
19
20
|
source?: ScoringSource;
|
|
20
|
-
pagination?:
|
|
21
|
-
page: number;
|
|
22
|
-
perPage: number;
|
|
23
|
-
};
|
|
21
|
+
pagination?: StoragePagination;
|
|
24
22
|
}): Promise<{
|
|
25
23
|
scores: ScoreRowData[];
|
|
26
|
-
pagination:
|
|
27
|
-
total: number;
|
|
28
|
-
page: number;
|
|
29
|
-
perPage: number;
|
|
30
|
-
hasMore: boolean;
|
|
31
|
-
};
|
|
24
|
+
pagination: PaginationInfo;
|
|
32
25
|
}>;
|
|
33
26
|
saveScore(score: ScoreRowData): Promise<{
|
|
34
27
|
score: ScoreRowData;
|
|
35
28
|
}>;
|
|
36
|
-
|
|
29
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
37
30
|
runId: string;
|
|
38
|
-
pagination?:
|
|
39
|
-
page: number;
|
|
40
|
-
perPage: number;
|
|
41
|
-
};
|
|
31
|
+
pagination?: StoragePagination;
|
|
42
32
|
}): Promise<{
|
|
43
33
|
scores: ScoreRowData[];
|
|
44
|
-
pagination:
|
|
45
|
-
total: number;
|
|
46
|
-
page: number;
|
|
47
|
-
perPage: number;
|
|
48
|
-
hasMore: boolean;
|
|
49
|
-
};
|
|
34
|
+
pagination: PaginationInfo;
|
|
50
35
|
}>;
|
|
51
|
-
|
|
36
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
52
37
|
entityId: string;
|
|
53
38
|
entityType?: string;
|
|
54
|
-
pagination?:
|
|
55
|
-
page: number;
|
|
56
|
-
perPage: number;
|
|
57
|
-
};
|
|
39
|
+
pagination?: StoragePagination;
|
|
58
40
|
}): Promise<{
|
|
59
41
|
scores: ScoreRowData[];
|
|
60
|
-
pagination:
|
|
61
|
-
total: number;
|
|
62
|
-
page: number;
|
|
63
|
-
perPage: number;
|
|
64
|
-
hasMore: boolean;
|
|
65
|
-
};
|
|
42
|
+
pagination: PaginationInfo;
|
|
66
43
|
}>;
|
|
67
|
-
|
|
44
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
68
45
|
traceId: string;
|
|
69
46
|
spanId: string;
|
|
70
|
-
pagination?:
|
|
71
|
-
page: number;
|
|
72
|
-
perPage: number;
|
|
73
|
-
};
|
|
47
|
+
pagination?: StoragePagination;
|
|
74
48
|
}): Promise<{
|
|
75
49
|
scores: ScoreRowData[];
|
|
76
|
-
pagination:
|
|
77
|
-
total: number;
|
|
78
|
-
page: number;
|
|
79
|
-
perPage: number;
|
|
80
|
-
hasMore: boolean;
|
|
81
|
-
};
|
|
50
|
+
pagination: PaginationInfo;
|
|
82
51
|
}>;
|
|
83
52
|
}
|
|
84
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAyC,aAAa,EAAiB,MAAM,sBAAsB,CAAC;AAC3G,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAgC5D,qBAAa,aAAc,SAAQ,aAAa;IAC9C,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,UAAU,CAAyB;gBAE/B,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,sBAAsB,CAAA;KAAE;IAMnF,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAqBlE,oBAAoB,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,MAAM,EACN,UAAqC,GACtC,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,CAAC,EAAE,iBAAiB,CAAC;KAChC,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,YAAY,EAAE,CAAC;QACvB,UAAU,EAAE,cAAc,CAAC;KAC5B,CAAC;IAmDI,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IA+BhE,iBAAiB,CAAC,EACtB,KAAK,EACL,UAAqC,GACtC,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,iBAAiB,CAAC;KAChC,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,YAAY,EAAE,CAAC;QACvB,UAAU,EAAE,cAAc,CAAC;KAC5B,CAAC;IA4CI,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,UAAqC,GACtC,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,iBAAiB,CAAC;KAChC,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,YAAY,EAAE,CAAC;QACvB,UAAU,EAAE,cAAc,CAAC;KAC5B,CAAC;IAiDI,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAqC,GACtC,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,iBAAiB,CAAC;KAChC,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,YAAY,EAAE,CAAC;QACvB,UAAU,EAAE,cAAc,CAAC;KAC5B,CAAC;CAgDH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAMlD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CASzC;AAED,wBAAgB,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAKhF;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;EA2BhF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { StepResult, WorkflowRun, WorkflowRuns, WorkflowRunState } from '@mastra/core';
|
|
2
1
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageListWorkflowRunsInput, WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
3
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
3
4
|
import type { Redis } from '@upstash/redis';
|
|
4
5
|
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
6
|
export declare class WorkflowsUpstash extends WorkflowsStorage {
|
|
@@ -14,7 +15,7 @@ export declare class WorkflowsUpstash extends WorkflowsStorage {
|
|
|
14
15
|
runId: string;
|
|
15
16
|
stepId: string;
|
|
16
17
|
result: StepResult<any, any, any, any>;
|
|
17
|
-
|
|
18
|
+
requestContext: Record<string, any>;
|
|
18
19
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
19
20
|
updateWorkflowState({}: {
|
|
20
21
|
workflowName: string;
|
|
@@ -43,13 +44,6 @@ export declare class WorkflowsUpstash extends WorkflowsStorage {
|
|
|
43
44
|
runId: string;
|
|
44
45
|
workflowName?: string;
|
|
45
46
|
}): Promise<WorkflowRun | null>;
|
|
46
|
-
|
|
47
|
-
workflowName?: string;
|
|
48
|
-
fromDate?: Date;
|
|
49
|
-
toDate?: Date;
|
|
50
|
-
limit?: number;
|
|
51
|
-
offset?: number;
|
|
52
|
-
resourceId?: string;
|
|
53
|
-
}): Promise<WorkflowRuns>;
|
|
47
|
+
listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, }: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
54
48
|
}
|
|
55
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EAAE,4BAA4B,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAuB5D,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,UAAU,CAAyB;gBAE/B,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,sBAAsB,CAAA;KAAE;IAMzF,qBAAqB,CACnB,EAMC,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACv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,CAAC,EACrB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,UAAU,GACX,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC;CAwFxD"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { MastraMessageContentV2,
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { MastraMessageContentV2, MastraDBMessage } from '@mastra/core/agent';
|
|
2
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
3
|
+
import type { StorageThreadType } from '@mastra/core/memory';
|
|
4
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
5
|
-
import type { TABLE_NAMES, StorageColumn,
|
|
5
|
+
import type { TABLE_NAMES, StorageColumn, StorageResourceType, WorkflowRuns, WorkflowRun, PaginationInfo, StoragePagination, StorageDomains, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
6
6
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
7
7
|
export interface UpstashConfig {
|
|
8
|
+
id: string;
|
|
8
9
|
url: string;
|
|
9
10
|
token: string;
|
|
10
11
|
}
|
|
@@ -18,38 +19,8 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
18
19
|
hasColumn: boolean;
|
|
19
20
|
createTable: boolean;
|
|
20
21
|
deleteMessages: boolean;
|
|
21
|
-
|
|
22
|
+
listScoresBySpan: boolean;
|
|
22
23
|
};
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Use getEvals instead
|
|
25
|
-
*/
|
|
26
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Get all evaluations with pagination and total count
|
|
29
|
-
* @param options Pagination and filtering options
|
|
30
|
-
* @returns Object with evals array and total count
|
|
31
|
-
*/
|
|
32
|
-
getEvals(options: {
|
|
33
|
-
agentName?: string;
|
|
34
|
-
type?: 'test' | 'live';
|
|
35
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
36
|
-
evals: EvalRow[];
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated use getTracesPaginated instead
|
|
40
|
-
*/
|
|
41
|
-
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
42
|
-
getTracesPaginated(args: {
|
|
43
|
-
name?: string;
|
|
44
|
-
scope?: string;
|
|
45
|
-
attributes?: Record<string, string>;
|
|
46
|
-
filters?: Record<string, any>;
|
|
47
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
48
|
-
traces: any[];
|
|
49
|
-
}>;
|
|
50
|
-
batchTraceInsert(args: {
|
|
51
|
-
records: Record<string, any>[];
|
|
52
|
-
}): Promise<void>;
|
|
53
24
|
createTable({ tableName, schema, }: {
|
|
54
25
|
tableName: TABLE_NAMES;
|
|
55
26
|
schema: Record<string, StorageColumn>;
|
|
@@ -86,19 +57,6 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
86
57
|
getThreadById({ threadId }: {
|
|
87
58
|
threadId: string;
|
|
88
59
|
}): Promise<StorageThreadType | null>;
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
91
|
-
*/
|
|
92
|
-
getThreadsByResourceId({ resourceId }: {
|
|
93
|
-
resourceId: string;
|
|
94
|
-
}): Promise<StorageThreadType[]>;
|
|
95
|
-
getThreadsByResourceIdPaginated(args: {
|
|
96
|
-
resourceId: string;
|
|
97
|
-
page: number;
|
|
98
|
-
perPage: number;
|
|
99
|
-
}): Promise<PaginationInfo & {
|
|
100
|
-
threads: StorageThreadType[];
|
|
101
|
-
}>;
|
|
102
60
|
saveThread({ thread }: {
|
|
103
61
|
thread: StorageThreadType;
|
|
104
62
|
}): Promise<StorageThreadType>;
|
|
@@ -111,41 +69,21 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
111
69
|
threadId: string;
|
|
112
70
|
}): Promise<void>;
|
|
113
71
|
saveMessages(args: {
|
|
114
|
-
messages:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
format: 'v2';
|
|
120
|
-
}): Promise<MastraMessageV2[]>;
|
|
121
|
-
/**
|
|
122
|
-
* @deprecated use getMessagesPaginated instead
|
|
123
|
-
*/
|
|
124
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
125
|
-
format?: 'v1';
|
|
126
|
-
}): Promise<MastraMessageV1[]>;
|
|
127
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
128
|
-
format: 'v2';
|
|
129
|
-
}): Promise<MastraMessageV2[]>;
|
|
130
|
-
getMessagesById({ messageIds, format }: {
|
|
131
|
-
messageIds: string[];
|
|
132
|
-
format: 'v1';
|
|
133
|
-
}): Promise<MastraMessageV1[]>;
|
|
134
|
-
getMessagesById({ messageIds, format }: {
|
|
72
|
+
messages: MastraDBMessage[];
|
|
73
|
+
}): Promise<{
|
|
74
|
+
messages: MastraDBMessage[];
|
|
75
|
+
}>;
|
|
76
|
+
listMessagesById({ messageIds }: {
|
|
135
77
|
messageIds: string[];
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
139
|
-
format?: 'v1' | 'v2';
|
|
140
|
-
}): Promise<PaginationInfo & {
|
|
141
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
78
|
+
}): Promise<{
|
|
79
|
+
messages: MastraDBMessage[];
|
|
142
80
|
}>;
|
|
143
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
81
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
144
82
|
workflowName: string;
|
|
145
83
|
runId: string;
|
|
146
84
|
stepId: string;
|
|
147
85
|
result: StepResult<any, any, any, any>;
|
|
148
|
-
|
|
86
|
+
requestContext: Record<string, any>;
|
|
149
87
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
150
88
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
151
89
|
workflowName: string;
|
|
@@ -170,28 +108,21 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
170
108
|
workflowName: string;
|
|
171
109
|
runId: string;
|
|
172
110
|
}): Promise<WorkflowRunState | null>;
|
|
173
|
-
|
|
174
|
-
workflowName?: string;
|
|
175
|
-
fromDate?: Date;
|
|
176
|
-
toDate?: Date;
|
|
177
|
-
limit?: number;
|
|
178
|
-
offset?: number;
|
|
179
|
-
resourceId?: string;
|
|
180
|
-
}): Promise<WorkflowRuns>;
|
|
111
|
+
listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
181
112
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
182
113
|
runId: string;
|
|
183
114
|
workflowName?: string;
|
|
184
115
|
}): Promise<WorkflowRun | null>;
|
|
185
116
|
close(): Promise<void>;
|
|
186
117
|
updateMessages(args: {
|
|
187
|
-
messages: (Partial<Omit<
|
|
118
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
188
119
|
id: string;
|
|
189
120
|
content?: {
|
|
190
121
|
metadata?: MastraMessageContentV2['metadata'];
|
|
191
122
|
content?: MastraMessageContentV2['content'];
|
|
192
123
|
};
|
|
193
124
|
})[];
|
|
194
|
-
}): Promise<
|
|
125
|
+
}): Promise<MastraDBMessage[]>;
|
|
195
126
|
deleteMessages(messageIds: string[]): Promise<void>;
|
|
196
127
|
getResourceById({ resourceId }: {
|
|
197
128
|
resourceId: string;
|
|
@@ -210,14 +141,14 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
210
141
|
saveScore(score: ScoreRowData): Promise<{
|
|
211
142
|
score: ScoreRowData;
|
|
212
143
|
}>;
|
|
213
|
-
|
|
144
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
214
145
|
runId: string;
|
|
215
146
|
pagination: StoragePagination;
|
|
216
147
|
}): Promise<{
|
|
217
148
|
pagination: PaginationInfo;
|
|
218
149
|
scores: ScoreRowData[];
|
|
219
150
|
}>;
|
|
220
|
-
|
|
151
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
221
152
|
pagination: StoragePagination;
|
|
222
153
|
entityId: string;
|
|
223
154
|
entityType: string;
|
|
@@ -225,7 +156,7 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
225
156
|
pagination: PaginationInfo;
|
|
226
157
|
scores: ScoreRowData[];
|
|
227
158
|
}>;
|
|
228
|
-
|
|
159
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
229
160
|
scorerId: string;
|
|
230
161
|
pagination: StoragePagination;
|
|
231
162
|
entityId?: string;
|
|
@@ -235,7 +166,7 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
235
166
|
pagination: PaginationInfo;
|
|
236
167
|
scores: ScoreRowData[];
|
|
237
168
|
}>;
|
|
238
|
-
|
|
169
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
239
170
|
traceId: string;
|
|
240
171
|
spanId: string;
|
|
241
172
|
pagination: StoragePagination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,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,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/dist/vector/index.d.ts
CHANGED
|
@@ -7,12 +7,15 @@ export declare class UpstashVector extends MastraVector<UpstashVectorFilter> {
|
|
|
7
7
|
/**
|
|
8
8
|
* Creates a new UpstashVector instance.
|
|
9
9
|
* @param {object} params - The parameters for the UpstashVector.
|
|
10
|
+
* @param {string} params.id - The unique identifier for this vector store instance.
|
|
10
11
|
* @param {string} params.url - The URL of the Upstash vector index.
|
|
11
12
|
* @param {string} params.token - The token for the Upstash vector index.
|
|
12
13
|
*/
|
|
13
|
-
constructor({ url, token }: {
|
|
14
|
+
constructor({ url, token, id }: {
|
|
14
15
|
url: string;
|
|
15
16
|
token: string;
|
|
17
|
+
} & {
|
|
18
|
+
id: string;
|
|
16
19
|
});
|
|
17
20
|
/**
|
|
18
21
|
* Upserts vectors into the index.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAE9G,qBAAa,aAA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;IAoCpD;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAgBtC;;;;;OAKG;IACG,aAAa,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAsBvF;;;;OAIG;IACG,WAAW,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB7E;;;;;;;;;OASG;IACG,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4ClG;;;;;;OAMG;IACG,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAkBpF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/upstash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "Upstash provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"tsup": "^8.5.0",
|
|
32
32
|
"typescript": "^5.8.3",
|
|
33
33
|
"vitest": "^3.2.4",
|
|
34
|
-
"@internal/lint": "0.0.
|
|
35
|
-
"@internal/storage-test-utils": "0.0.
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
34
|
+
"@internal/lint": "0.0.53",
|
|
35
|
+
"@internal/storage-test-utils": "0.0.49",
|
|
36
|
+
"@internal/types-builder": "0.0.28",
|
|
37
|
+
"@mastra/core": "1.0.0-beta.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@mastra/core": ">=0.
|
|
40
|
+
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"dist",
|
|
@@ -52,12 +52,8 @@
|
|
|
52
52
|
"bugs": {
|
|
53
53
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
54
54
|
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"publish-branch": [
|
|
58
|
-
"main",
|
|
59
|
-
"0.x"
|
|
60
|
-
]
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.13.0"
|
|
61
57
|
},
|
|
62
58
|
"scripts": {
|
|
63
59
|
"pretest": "docker compose up -d",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { EvalRow, PaginationArgs, PaginationInfo } from '@mastra/core/storage';
|
|
2
|
-
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { Redis } from '@upstash/redis';
|
|
4
|
-
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
|
-
export declare class StoreLegacyEvalsUpstash extends LegacyEvalsStorage {
|
|
6
|
-
private client;
|
|
7
|
-
private operations;
|
|
8
|
-
constructor({ client, operations }: {
|
|
9
|
-
client: Redis;
|
|
10
|
-
operations: StoreOperationsUpstash;
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Use getEvals instead
|
|
14
|
-
*/
|
|
15
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Get all evaluations with pagination and total count
|
|
18
|
-
* @param options Pagination and filtering options
|
|
19
|
-
* @returns Object with evals array and total count
|
|
20
|
-
*/
|
|
21
|
-
getEvals(options?: {
|
|
22
|
-
agentName?: string;
|
|
23
|
-
type?: 'test' | 'live';
|
|
24
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
25
|
-
evals: EvalRow[];
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
//# 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":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAyC5D,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,UAAU,CAAyB;gBAC/B,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,sBAAsB,CAAA;KAAE;IAMzF;;OAEG;IACG,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA6ExF;;;;OAIG;IACG,QAAQ,CACZ,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,GAAG,cAAc,GACjB,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CAqIlD"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { StorageGetTracesArg, PaginationInfo, PaginationArgs } from '@mastra/core/storage';
|
|
2
|
-
import { TracesStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { Redis } from '@upstash/redis';
|
|
4
|
-
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
|
-
export declare class TracesUpstash extends TracesStorage {
|
|
6
|
-
private client;
|
|
7
|
-
private operations;
|
|
8
|
-
constructor({ client, operations }: {
|
|
9
|
-
client: Redis;
|
|
10
|
-
operations: StoreOperationsUpstash;
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated use getTracesPaginated instead
|
|
14
|
-
*/
|
|
15
|
-
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
16
|
-
getTracesPaginated(args: {
|
|
17
|
-
name?: string;
|
|
18
|
-
scope?: string;
|
|
19
|
-
attributes?: Record<string, string>;
|
|
20
|
-
filters?: Record<string, any>;
|
|
21
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
22
|
-
traces: any[];
|
|
23
|
-
}>;
|
|
24
|
-
batchTraceInsert(args: {
|
|
25
|
-
records: Record<string, any>[];
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/traces/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAgB,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG5D,qBAAa,aAAc,SAAQ,aAAa;IAC9C,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,UAAU,CAAyB;gBAE/B,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,sBAAsB,CAAA;KAAE;IAMzF;;OAEG;IACU,SAAS,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAsBpD,kBAAkB,CAC7B,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B,GAAG,cAAc,GACjB,OAAO,CAAC,cAAc,GAAG;QAAE,MAAM,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAoHxC,gBAAgB,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMhF"}
|