@mastra/upstash 0.10.3-alpha.1 → 0.10.3-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +17 -0
- package/dist/_tsup-dts-rollup.d.cts +25 -51
- package/dist/_tsup-dts-rollup.d.ts +25 -51
- package/dist/index.cjs +384 -384
- package/dist/index.js +384 -384
- package/package.json +3 -3
- package/src/storage/index.ts +313 -365
- package/src/storage/upstash.test.ts +190 -102
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/upstash@0.10.3-alpha.
|
|
2
|
+
> @mastra/upstash@0.10.3-alpha.3 build /home/runner/work/mastra/mastra/stores/upstash
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 9774ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 10947ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
20
|
dist/index.cjs (1651:18): Use of eval in "dist/index.cjs" is strongly discouraged as it poses security risks and may cause issues with minification.
|
|
21
21
|
dist/index.js (1651:18): Use of eval in "dist/index.js" is strongly discouraged as it poses security risks and may cause issues with minification.
|
|
22
|
+
[32mCJS[39m [1mdist/getMachineId-win-ZTI2LRDJ.cjs [22m[32m1.66 KB[39m
|
|
22
23
|
[32mCJS[39m [1mdist/getMachineId-darwin-3PL23DL6.cjs [22m[32m1.19 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/getMachineId-unsupported-DEDJN4ZS.cjs [22m[32m777.00 B[39m
|
|
25
|
+
[32mCJS[39m [1mdist/chunk-N2CPQVE3.cjs [22m[32m1.09 KB[39m
|
|
23
26
|
[32mCJS[39m [1mdist/getMachineId-linux-KYLPK3HC.cjs [22m[32m813.00 B[39m
|
|
24
27
|
[32mCJS[39m [1mdist/getMachineId-bsd-HDZ73WR7.cjs [22m[32m1015.00 B[39m
|
|
25
|
-
[32mCJS[39m [1mdist/chunk-N2CPQVE3.cjs [22m[32m1.09 KB[39m
|
|
26
|
-
[32mCJS[39m [1mdist/getMachineId-win-ZTI2LRDJ.cjs [22m[32m1.66 KB[39m
|
|
27
|
-
[32mCJS[39m [1mdist/getMachineId-unsupported-DEDJN4ZS.cjs [22m[32m777.00 B[39m
|
|
28
28
|
[32mCJS[39m [1mdist/chunk-U74OJRHU.cjs [22m[32m62.08 KB[39m
|
|
29
29
|
[32mCJS[39m [1mdist/index.cjs [22m[32m1.65 MB[39m
|
|
30
|
-
[32mCJS[39m ⚡️ Build success in
|
|
31
|
-
[32mESM[39m [1mdist/getMachineId-linux-K3QXQYAB.js [22m[32m740.00 B[39m
|
|
30
|
+
[32mCJS[39m ⚡️ Build success in 22089ms
|
|
32
31
|
[32mESM[39m [1mdist/getMachineId-darwin-UTKBTJ2U.js [22m[32m1.08 KB[39m
|
|
33
|
-
[32mESM[39m [1mdist/getMachineId-
|
|
32
|
+
[32mESM[39m [1mdist/getMachineId-linux-K3QXQYAB.js [22m[32m740.00 B[39m
|
|
34
33
|
[32mESM[39m [1mdist/getMachineId-bsd-KKIDU47O.js [22m[32m896.00 B[39m
|
|
34
|
+
[32mESM[39m [1mdist/getMachineId-win-L2EYIM5A.js [22m[32m1.04 KB[39m
|
|
35
35
|
[32mESM[39m [1mdist/chunk-IGKEDEDE.js [22m[32m452.00 B[39m
|
|
36
36
|
[32mESM[39m [1mdist/getMachineId-unsupported-VPWBQCK7.js [22m[32m700.00 B[39m
|
|
37
37
|
[32mESM[39m [1mdist/chunk-HSTZWXH7.js [22m[32m61.52 KB[39m
|
|
38
38
|
[32mESM[39m [1mdist/index.js [22m[32m1.64 MB[39m
|
|
39
|
-
[32mESM[39m ⚡️ Build success in
|
|
39
|
+
[32mESM[39m ⚡️ Build success in 22103ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @mastra/upstash
|
|
2
2
|
|
|
3
|
+
## 0.10.3-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 925ab94: added paginated functions to base class and added boilerplate and updated imports
|
|
8
|
+
- a914da2: Fix upstash paginated APIs
|
|
9
|
+
- Updated dependencies [925ab94]
|
|
10
|
+
- @mastra/core@0.10.4-alpha.3
|
|
11
|
+
|
|
12
|
+
## 0.10.3-alpha.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 48eddb9: update filter logic in Memory class to support semantic recall search scope
|
|
17
|
+
- Updated dependencies [48eddb9]
|
|
18
|
+
- @mastra/core@0.10.4-alpha.2
|
|
19
|
+
|
|
3
20
|
## 0.10.3-alpha.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -10,10 +10,13 @@ import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
|
10
10
|
import { MastraStorage } from '@mastra/core/storage';
|
|
11
11
|
import { MastraVector } from '@mastra/core/vector';
|
|
12
12
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
13
|
+
import type { PaginationArgs } from '@mastra/core/storage';
|
|
14
|
+
import type { PaginationInfo } from '@mastra/core/storage';
|
|
13
15
|
import type { QueryResult } from '@mastra/core/vector';
|
|
14
16
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
15
17
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
16
18
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
19
|
+
import type { StorageGetTracesArg } from '@mastra/core/storage';
|
|
17
20
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
18
21
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
19
22
|
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
@@ -55,6 +58,9 @@ export declare class UpstashFilterTranslator extends BaseFilterTranslator {
|
|
|
55
58
|
declare class UpstashStore extends MastraStorage {
|
|
56
59
|
private redis;
|
|
57
60
|
constructor(config: UpstashConfig);
|
|
61
|
+
get supports(): {
|
|
62
|
+
selectByIncludeResourceScope: boolean;
|
|
63
|
+
};
|
|
58
64
|
private transformEvalRecord;
|
|
59
65
|
private parseJSON;
|
|
60
66
|
private getKey;
|
|
@@ -78,32 +84,17 @@ declare class UpstashStore extends MastraStorage {
|
|
|
78
84
|
* @deprecated Use getEvals instead
|
|
79
85
|
*/
|
|
80
86
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
page: number;
|
|
87
|
-
perPage?: number;
|
|
88
|
-
fromDate?: Date;
|
|
89
|
-
toDate?: Date;
|
|
90
|
-
}): Promise<any[]>;
|
|
91
|
-
getTraces(args: {
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated use getTracesPaginated instead
|
|
89
|
+
*/
|
|
90
|
+
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
91
|
+
getTracesPaginated(args: {
|
|
92
92
|
name?: string;
|
|
93
93
|
scope?: string;
|
|
94
|
-
page: number;
|
|
95
|
-
perPage?: number;
|
|
96
94
|
attributes?: Record<string, string>;
|
|
97
95
|
filters?: Record<string, any>;
|
|
98
|
-
|
|
99
|
-
toDate?: Date;
|
|
100
|
-
returnPaginationResults: true;
|
|
101
|
-
}): Promise<{
|
|
96
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
102
97
|
traces: any[];
|
|
103
|
-
total: number;
|
|
104
|
-
page: number;
|
|
105
|
-
perPage: number;
|
|
106
|
-
hasMore: boolean;
|
|
107
98
|
}>;
|
|
108
99
|
createTable({ tableName, schema, }: {
|
|
109
100
|
tableName: TABLE_NAMES;
|
|
@@ -138,19 +129,16 @@ declare class UpstashStore extends MastraStorage {
|
|
|
138
129
|
getThreadById({ threadId }: {
|
|
139
130
|
threadId: string;
|
|
140
131
|
}): Promise<StorageThreadType | null>;
|
|
141
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
134
|
+
*/
|
|
135
|
+
getThreadsByResourceId({ resourceId }: {
|
|
142
136
|
resourceId: string;
|
|
143
137
|
}): Promise<StorageThreadType[]>;
|
|
144
|
-
|
|
138
|
+
getThreadsByResourceIdPaginated(args: {
|
|
145
139
|
resourceId: string;
|
|
146
|
-
|
|
147
|
-
perPage?: number;
|
|
148
|
-
}): Promise<{
|
|
140
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
149
141
|
threads: StorageThreadType[];
|
|
150
|
-
total: number;
|
|
151
|
-
page: number;
|
|
152
|
-
perPage: number;
|
|
153
|
-
hasMore: boolean;
|
|
154
142
|
}>;
|
|
155
143
|
saveThread({ thread }: {
|
|
156
144
|
thread: StorageThreadType;
|
|
@@ -171,24 +159,20 @@ declare class UpstashStore extends MastraStorage {
|
|
|
171
159
|
messages: MastraMessageV2[];
|
|
172
160
|
format: 'v2';
|
|
173
161
|
}): Promise<MastraMessageV2[]>;
|
|
162
|
+
private _getIncludedMessages;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated use getMessagesPaginated instead
|
|
165
|
+
*/
|
|
174
166
|
getMessages(args: StorageGetMessagesArg & {
|
|
175
167
|
format?: 'v1';
|
|
176
168
|
}): Promise<MastraMessageV1[]>;
|
|
177
169
|
getMessages(args: StorageGetMessagesArg & {
|
|
178
170
|
format: 'v2';
|
|
179
171
|
}): Promise<MastraMessageV2[]>;
|
|
180
|
-
|
|
172
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
181
173
|
format?: 'v1' | 'v2';
|
|
182
|
-
|
|
183
|
-
perPage?: number;
|
|
184
|
-
fromDate?: Date;
|
|
185
|
-
toDate?: Date;
|
|
186
|
-
}): Promise<{
|
|
174
|
+
}): Promise<PaginationInfo & {
|
|
187
175
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
188
|
-
total: number;
|
|
189
|
-
page: number;
|
|
190
|
-
perPage: number;
|
|
191
|
-
hasMore: boolean;
|
|
192
176
|
}>;
|
|
193
177
|
persistWorkflowSnapshot(params: {
|
|
194
178
|
namespace: string;
|
|
@@ -209,18 +193,8 @@ declare class UpstashStore extends MastraStorage {
|
|
|
209
193
|
getEvals(options?: {
|
|
210
194
|
agentName?: string;
|
|
211
195
|
type?: 'test' | 'live';
|
|
212
|
-
|
|
213
|
-
perPage?: number;
|
|
214
|
-
limit?: number;
|
|
215
|
-
offset?: number;
|
|
216
|
-
fromDate?: Date;
|
|
217
|
-
toDate?: Date;
|
|
218
|
-
}): Promise<{
|
|
196
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
219
197
|
evals: EvalRow[];
|
|
220
|
-
total: number;
|
|
221
|
-
page?: number;
|
|
222
|
-
perPage?: number;
|
|
223
|
-
hasMore?: boolean;
|
|
224
198
|
}>;
|
|
225
199
|
getWorkflowRuns({ namespace, workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
226
200
|
namespace: string;
|
|
@@ -10,10 +10,13 @@ import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
|
10
10
|
import { MastraStorage } from '@mastra/core/storage';
|
|
11
11
|
import { MastraVector } from '@mastra/core/vector';
|
|
12
12
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
13
|
+
import type { PaginationArgs } from '@mastra/core/storage';
|
|
14
|
+
import type { PaginationInfo } from '@mastra/core/storage';
|
|
13
15
|
import type { QueryResult } from '@mastra/core/vector';
|
|
14
16
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
15
17
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
16
18
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
19
|
+
import type { StorageGetTracesArg } from '@mastra/core/storage';
|
|
17
20
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
18
21
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
19
22
|
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
@@ -55,6 +58,9 @@ export declare class UpstashFilterTranslator extends BaseFilterTranslator {
|
|
|
55
58
|
declare class UpstashStore extends MastraStorage {
|
|
56
59
|
private redis;
|
|
57
60
|
constructor(config: UpstashConfig);
|
|
61
|
+
get supports(): {
|
|
62
|
+
selectByIncludeResourceScope: boolean;
|
|
63
|
+
};
|
|
58
64
|
private transformEvalRecord;
|
|
59
65
|
private parseJSON;
|
|
60
66
|
private getKey;
|
|
@@ -78,32 +84,17 @@ declare class UpstashStore extends MastraStorage {
|
|
|
78
84
|
* @deprecated Use getEvals instead
|
|
79
85
|
*/
|
|
80
86
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
page: number;
|
|
87
|
-
perPage?: number;
|
|
88
|
-
fromDate?: Date;
|
|
89
|
-
toDate?: Date;
|
|
90
|
-
}): Promise<any[]>;
|
|
91
|
-
getTraces(args: {
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated use getTracesPaginated instead
|
|
89
|
+
*/
|
|
90
|
+
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
91
|
+
getTracesPaginated(args: {
|
|
92
92
|
name?: string;
|
|
93
93
|
scope?: string;
|
|
94
|
-
page: number;
|
|
95
|
-
perPage?: number;
|
|
96
94
|
attributes?: Record<string, string>;
|
|
97
95
|
filters?: Record<string, any>;
|
|
98
|
-
|
|
99
|
-
toDate?: Date;
|
|
100
|
-
returnPaginationResults: true;
|
|
101
|
-
}): Promise<{
|
|
96
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
102
97
|
traces: any[];
|
|
103
|
-
total: number;
|
|
104
|
-
page: number;
|
|
105
|
-
perPage: number;
|
|
106
|
-
hasMore: boolean;
|
|
107
98
|
}>;
|
|
108
99
|
createTable({ tableName, schema, }: {
|
|
109
100
|
tableName: TABLE_NAMES;
|
|
@@ -138,19 +129,16 @@ declare class UpstashStore extends MastraStorage {
|
|
|
138
129
|
getThreadById({ threadId }: {
|
|
139
130
|
threadId: string;
|
|
140
131
|
}): Promise<StorageThreadType | null>;
|
|
141
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
134
|
+
*/
|
|
135
|
+
getThreadsByResourceId({ resourceId }: {
|
|
142
136
|
resourceId: string;
|
|
143
137
|
}): Promise<StorageThreadType[]>;
|
|
144
|
-
|
|
138
|
+
getThreadsByResourceIdPaginated(args: {
|
|
145
139
|
resourceId: string;
|
|
146
|
-
|
|
147
|
-
perPage?: number;
|
|
148
|
-
}): Promise<{
|
|
140
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
149
141
|
threads: StorageThreadType[];
|
|
150
|
-
total: number;
|
|
151
|
-
page: number;
|
|
152
|
-
perPage: number;
|
|
153
|
-
hasMore: boolean;
|
|
154
142
|
}>;
|
|
155
143
|
saveThread({ thread }: {
|
|
156
144
|
thread: StorageThreadType;
|
|
@@ -171,24 +159,20 @@ declare class UpstashStore extends MastraStorage {
|
|
|
171
159
|
messages: MastraMessageV2[];
|
|
172
160
|
format: 'v2';
|
|
173
161
|
}): Promise<MastraMessageV2[]>;
|
|
162
|
+
private _getIncludedMessages;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated use getMessagesPaginated instead
|
|
165
|
+
*/
|
|
174
166
|
getMessages(args: StorageGetMessagesArg & {
|
|
175
167
|
format?: 'v1';
|
|
176
168
|
}): Promise<MastraMessageV1[]>;
|
|
177
169
|
getMessages(args: StorageGetMessagesArg & {
|
|
178
170
|
format: 'v2';
|
|
179
171
|
}): Promise<MastraMessageV2[]>;
|
|
180
|
-
|
|
172
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
181
173
|
format?: 'v1' | 'v2';
|
|
182
|
-
|
|
183
|
-
perPage?: number;
|
|
184
|
-
fromDate?: Date;
|
|
185
|
-
toDate?: Date;
|
|
186
|
-
}): Promise<{
|
|
174
|
+
}): Promise<PaginationInfo & {
|
|
187
175
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
188
|
-
total: number;
|
|
189
|
-
page: number;
|
|
190
|
-
perPage: number;
|
|
191
|
-
hasMore: boolean;
|
|
192
176
|
}>;
|
|
193
177
|
persistWorkflowSnapshot(params: {
|
|
194
178
|
namespace: string;
|
|
@@ -209,18 +193,8 @@ declare class UpstashStore extends MastraStorage {
|
|
|
209
193
|
getEvals(options?: {
|
|
210
194
|
agentName?: string;
|
|
211
195
|
type?: 'test' | 'live';
|
|
212
|
-
|
|
213
|
-
perPage?: number;
|
|
214
|
-
limit?: number;
|
|
215
|
-
offset?: number;
|
|
216
|
-
fromDate?: Date;
|
|
217
|
-
toDate?: Date;
|
|
218
|
-
}): Promise<{
|
|
196
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
219
197
|
evals: EvalRow[];
|
|
220
|
-
total: number;
|
|
221
|
-
page?: number;
|
|
222
|
-
perPage?: number;
|
|
223
|
-
hasMore?: boolean;
|
|
224
198
|
}>;
|
|
225
199
|
getWorkflowRuns({ namespace, workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
226
200
|
namespace: string;
|