@mastra/upstash 0.0.0-zod-v4-compat-part-2-20250822105954 → 0.0.0-zod-v4-stuff-20250825154219
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 +106 -2
- package/dist/index.cjs +71 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +72 -5
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/legacy-evals/index.d.ts +1 -1
- package/dist/storage/domains/memory/index.d.ts +10 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +6 -3
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/traces/index.d.ts +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +1 -1
- package/dist/storage/index.d.ts +13 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +2 -2
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/types.d.ts +1 -1
- package/package.json +8 -7
- package/src/storage/domains/memory/index.ts +67 -0
- package/src/storage/domains/scores/index.ts +18 -3
- package/src/storage/domains/utils.ts +9 -1
- package/src/storage/index.ts +20 -2
- package/src/vector/index.ts +2 -1
- package/tsup.config.ts +2 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EvalRow, PaginationArgs, PaginationInfo } from '@mastra/core/storage';
|
|
2
2
|
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { Redis } from '@upstash/redis';
|
|
4
|
-
import type { StoreOperationsUpstash } from '../operations';
|
|
4
|
+
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
5
|
export declare class StoreLegacyEvalsUpstash extends LegacyEvalsStorage {
|
|
6
6
|
private client;
|
|
7
7
|
private operations;
|
|
@@ -3,7 +3,7 @@ import type { MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastr
|
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { StorageGetMessagesArg, PaginationInfo, StorageResourceType } from '@mastra/core/storage';
|
|
5
5
|
import type { Redis } from '@upstash/redis';
|
|
6
|
-
import type { StoreOperationsUpstash } from '../operations';
|
|
6
|
+
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
7
7
|
export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
8
8
|
private client;
|
|
9
9
|
private operations;
|
|
@@ -47,6 +47,7 @@ export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
|
47
47
|
format: 'v2';
|
|
48
48
|
}): Promise<MastraMessageV2[]>;
|
|
49
49
|
private _getIncludedMessages;
|
|
50
|
+
private parseStoredMessage;
|
|
50
51
|
/**
|
|
51
52
|
* @deprecated use getMessagesPaginated instead
|
|
52
53
|
*/
|
|
@@ -56,6 +57,14 @@ export declare class StoreMemoryUpstash extends MemoryStorage {
|
|
|
56
57
|
getMessages(args: StorageGetMessagesArg & {
|
|
57
58
|
format: 'v2';
|
|
58
59
|
}): Promise<MastraMessageV2[]>;
|
|
60
|
+
getMessagesById({ messageIds, format, }: {
|
|
61
|
+
messageIds: string[];
|
|
62
|
+
format: 'v1';
|
|
63
|
+
}): Promise<MastraMessageV1[]>;
|
|
64
|
+
getMessagesById({ messageIds, format, }: {
|
|
65
|
+
messageIds: string[];
|
|
66
|
+
format?: 'v2';
|
|
67
|
+
}): Promise<MastraMessageV2[]>;
|
|
59
68
|
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
60
69
|
format?: 'v1' | 'v2';
|
|
61
70
|
}): Promise<PaginationInfo & {
|
|
@@ -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,eAAe,EAAE,eA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,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;IAkC1B,cAAc,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,GAAG;YACvD,EAAE,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;IA+JxB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAqE1D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
1
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { Redis } from '@upstash/redis';
|
|
4
|
-
import type { StoreOperationsUpstash } from '../operations';
|
|
4
|
+
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
5
|
export declare class ScoresUpstash extends ScoresStorage {
|
|
6
6
|
private client;
|
|
7
7
|
private operations;
|
|
@@ -12,8 +12,11 @@ export declare class ScoresUpstash extends ScoresStorage {
|
|
|
12
12
|
getScoreById({ id }: {
|
|
13
13
|
id: string;
|
|
14
14
|
}): Promise<ScoreRowData | null>;
|
|
15
|
-
getScoresByScorerId({ scorerId, pagination, }: {
|
|
15
|
+
getScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
|
|
16
16
|
scorerId: string;
|
|
17
|
+
entityId?: string;
|
|
18
|
+
entityType?: string;
|
|
19
|
+
source?: ScoringSource;
|
|
17
20
|
pagination?: {
|
|
18
21
|
page: number;
|
|
19
22
|
perPage: number;
|
|
@@ -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,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAiB,MAAM,sBAAsB,CAAC;AACpE,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,mBAAmB,CAAC,EACxB,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;YAAE,IAAI,EAAE,MA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CH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StorageGetTracesArg, PaginationInfo, PaginationArgs } from '@mastra/core/storage';
|
|
2
2
|
import { TracesStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { Redis } from '@upstash/redis';
|
|
4
|
-
import type { StoreOperationsUpstash } from '../operations';
|
|
4
|
+
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
5
|
export declare class TracesUpstash extends TracesStorage {
|
|
6
6
|
private client;
|
|
7
7
|
private operations;
|
|
@@ -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":"AAOA,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;;;;;;EA6BhF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WorkflowRun, WorkflowRuns, WorkflowRunState } from '@mastra/core';
|
|
2
2
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { Redis } from '@upstash/redis';
|
|
4
|
-
import type { StoreOperationsUpstash } from '../operations';
|
|
4
|
+
import type { StoreOperationsUpstash } from '../operations/index.js';
|
|
5
5
|
export declare class WorkflowsUpstash extends WorkflowsStorage {
|
|
6
6
|
private client;
|
|
7
7
|
private operations;
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MastraMessageContentV2, MastraMessageV2 } from '@mastra/core/agent';
|
|
2
2
|
import type { StorageThreadType, MastraMessageV1 } from '@mastra/core/memory';
|
|
3
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
3
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
4
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
5
5
|
import type { TABLE_NAMES, StorageColumn, StorageGetMessagesArg, StorageResourceType, EvalRow, WorkflowRuns, WorkflowRun, PaginationInfo, PaginationArgs, StorageGetTracesArg, StoragePagination, StorageDomains } from '@mastra/core/storage';
|
|
6
6
|
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
@@ -126,6 +126,14 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
126
126
|
getMessages(args: StorageGetMessagesArg & {
|
|
127
127
|
format: 'v2';
|
|
128
128
|
}): Promise<MastraMessageV2[]>;
|
|
129
|
+
getMessagesById({ messageIds, format }: {
|
|
130
|
+
messageIds: string[];
|
|
131
|
+
format: 'v1';
|
|
132
|
+
}): Promise<MastraMessageV1[]>;
|
|
133
|
+
getMessagesById({ messageIds, format }: {
|
|
134
|
+
messageIds: string[];
|
|
135
|
+
format?: 'v2';
|
|
136
|
+
}): Promise<MastraMessageV2[]>;
|
|
129
137
|
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
130
138
|
format?: 'v1' | 'v2';
|
|
131
139
|
}): Promise<PaginationInfo & {
|
|
@@ -197,9 +205,12 @@ export declare class UpstashStore extends MastraStorage {
|
|
|
197
205
|
pagination: PaginationInfo;
|
|
198
206
|
scores: ScoreRowData[];
|
|
199
207
|
}>;
|
|
200
|
-
getScoresByScorerId({ scorerId, pagination, }: {
|
|
208
|
+
getScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
201
209
|
scorerId: string;
|
|
202
210
|
pagination: StoragePagination;
|
|
211
|
+
entityId?: string;
|
|
212
|
+
entityType?: string;
|
|
213
|
+
source?: ScoringSource;
|
|
203
214
|
}): Promise<{
|
|
204
215
|
pagination: PaginationInfo;
|
|
205
216
|
scores: ScoreRowData[];
|
|
@@ -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,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
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,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAS/D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,YAAa,SAAQ,aAAa;IAC7C,OAAO,CAAC,KAAK,CAAQ;IACrB,MAAM,EAAE,c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CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAIhE,gBAAgB,CAAC,EACrB,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;IAI7D,mBAAmB,CAAC,EACxB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAQ7D,mBAAmB,CAAC,EACxB,QAAQ,EACR,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;CAGpE"}
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MastraVector } from '@mastra/core/vector';
|
|
2
2
|
import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult } from '@mastra/core/vector';
|
|
3
|
-
import type { UpstashVectorFilter } from './filter';
|
|
4
|
-
import type { UpstashUpsertVectorParams, UpstashQueryVectorParams, UpstashUpdateVectorParams } from './types';
|
|
3
|
+
import type { UpstashVectorFilter } from './filter.js';
|
|
4
|
+
import type { UpstashUpsertVectorParams, UpstashQueryVectorParams, UpstashUpdateVectorParams } from './types.js';
|
|
5
5
|
export declare class UpstashVector extends MastraVector<UpstashVectorFilter> {
|
|
6
6
|
private client;
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"
|
|
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,aAAc,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IAClE,OAAO,CAAC,MAAM,CAAQ;IAEtB;;;;;OAKG;gBACS,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAQ1D;;;;OAIG;IACG,MAAM,CAAC,EACX,SAAS,EAAE,SAAS,EACpB,OAAO,EACP,QAAQ,EACR,GAAG,EACH,aAAa,GACd,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA4BhD;;;;OAIG;IACH,eAAe,CAAC,MAAM,CAAC,EAAE,mBAAmB;IAK5C;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D;;;;OAIG;IACG,KAAK,CAAC,EACV,SAAS,EAAE,SAAS,EACpB,WAAW,EACX,IAAS,EACT,MAAM,EACN,aAAqB,EACrB,YAAY,EACZ,eAAe,EACf,SAAS,GACV,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;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/dist/vector/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UpsertVectorParams, QueryVectorParams, UpdateVectorParams } from '@mastra/core/vector';
|
|
2
2
|
import type { FusionAlgorithm, QueryMode } from '@upstash/vector';
|
|
3
|
-
import type { UpstashVectorFilter } from './filter';
|
|
3
|
+
import type { UpstashVectorFilter } from './filter.js';
|
|
4
4
|
export interface UpstashSparseVector {
|
|
5
5
|
indices: number[];
|
|
6
6
|
values: number[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/upstash",
|
|
3
|
-
"version": "0.0.0-zod-v4-
|
|
3
|
+
"version": "0.0.0-zod-v4-stuff-20250825154219",
|
|
4
4
|
"description": "Upstash provider for Mastra - includes both vector and db storage capabilities",
|
|
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,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@upstash/redis": "^1.35.
|
|
23
|
+
"@upstash/redis": "^1.35.3",
|
|
24
24
|
"@upstash/vector": "^1.2.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -31,12 +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.0-zod-v4-
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
34
|
+
"@internal/lint": "0.0.0-zod-v4-stuff-20250825154219",
|
|
35
|
+
"@internal/storage-test-utils": "0.0.27",
|
|
36
|
+
"@mastra/core": "0.0.0-zod-v4-stuff-20250825154219",
|
|
37
|
+
"@internal/types-builder": "0.0.0-zod-v4-stuff-20250825154219"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"@mastra/core": "0.0.0-zod-v4-
|
|
40
|
+
"@mastra/core": "0.0.0-zod-v4-stuff-20250825154219"
|
|
40
41
|
},
|
|
41
42
|
"scripts": {
|
|
42
43
|
"pretest": "docker compose up -d",
|
|
@@ -447,6 +447,16 @@ export class StoreMemoryUpstash extends MemoryStorage {
|
|
|
447
447
|
return [];
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
private parseStoredMessage(storedMessage: MastraMessageV2 & { _index?: number }): MastraMessageV2 {
|
|
451
|
+
const defaultMessageContent = { format: 2, parts: [{ type: 'text', text: '' }] };
|
|
452
|
+
const { _index, ...rest } = storedMessage;
|
|
453
|
+
return {
|
|
454
|
+
...rest,
|
|
455
|
+
createdAt: new Date(rest.createdAt),
|
|
456
|
+
content: rest.content || defaultMessageContent,
|
|
457
|
+
} satisfies MastraMessageV2;
|
|
458
|
+
}
|
|
459
|
+
|
|
450
460
|
/**
|
|
451
461
|
* @deprecated use getMessagesPaginated instead
|
|
452
462
|
*/
|
|
@@ -552,6 +562,63 @@ export class StoreMemoryUpstash extends MemoryStorage {
|
|
|
552
562
|
}
|
|
553
563
|
}
|
|
554
564
|
|
|
565
|
+
public async getMessagesById({
|
|
566
|
+
messageIds,
|
|
567
|
+
format,
|
|
568
|
+
}: {
|
|
569
|
+
messageIds: string[];
|
|
570
|
+
format: 'v1';
|
|
571
|
+
}): Promise<MastraMessageV1[]>;
|
|
572
|
+
public async getMessagesById({
|
|
573
|
+
messageIds,
|
|
574
|
+
format,
|
|
575
|
+
}: {
|
|
576
|
+
messageIds: string[];
|
|
577
|
+
format?: 'v2';
|
|
578
|
+
}): Promise<MastraMessageV2[]>;
|
|
579
|
+
public async getMessagesById({
|
|
580
|
+
messageIds,
|
|
581
|
+
format,
|
|
582
|
+
}: {
|
|
583
|
+
messageIds: string[];
|
|
584
|
+
format?: 'v1' | 'v2';
|
|
585
|
+
}): Promise<MastraMessageV1[] | MastraMessageV2[]> {
|
|
586
|
+
if (messageIds.length === 0) return [];
|
|
587
|
+
|
|
588
|
+
try {
|
|
589
|
+
// Search in all threads in parallel
|
|
590
|
+
const threadKeys = await this.client.keys('thread:*');
|
|
591
|
+
|
|
592
|
+
const result = await Promise.all(
|
|
593
|
+
threadKeys.map(threadKey => {
|
|
594
|
+
const threadId = threadKey.split(':')[1];
|
|
595
|
+
if (!threadId) throw new Error(`Failed to parse thread ID from thread key "${threadKey}"`);
|
|
596
|
+
return this.client.mget<(MastraMessageV2 & { _index?: number })[]>(
|
|
597
|
+
messageIds.map(id => getMessageKey(threadId, id)),
|
|
598
|
+
);
|
|
599
|
+
}),
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
const rawMessages = result.flat(1).filter(msg => !!msg) as (MastraMessageV2 & { _index?: number })[];
|
|
603
|
+
|
|
604
|
+
const list = new MessageList().add(rawMessages.map(this.parseStoredMessage), 'memory');
|
|
605
|
+
if (format === `v1`) return list.get.all.v1();
|
|
606
|
+
return list.get.all.v2();
|
|
607
|
+
} catch (error) {
|
|
608
|
+
throw new MastraError(
|
|
609
|
+
{
|
|
610
|
+
id: 'STORAGE_UPSTASH_STORAGE_GET_MESSAGES_BY_ID_FAILED',
|
|
611
|
+
domain: ErrorDomain.STORAGE,
|
|
612
|
+
category: ErrorCategory.THIRD_PARTY,
|
|
613
|
+
details: {
|
|
614
|
+
messageIds: JSON.stringify(messageIds),
|
|
615
|
+
},
|
|
616
|
+
},
|
|
617
|
+
error,
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
555
622
|
public async getMessagesPaginated(
|
|
556
623
|
args: StorageGetMessagesArg & {
|
|
557
624
|
format?: 'v1' | 'v2';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';
|
|
2
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
2
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
3
3
|
import { ScoresStorage, TABLE_SCORERS } from '@mastra/core/storage';
|
|
4
4
|
import type { Redis } from '@upstash/redis';
|
|
5
5
|
import type { StoreOperationsUpstash } from '../operations';
|
|
@@ -19,7 +19,9 @@ function transformScoreRow(row: Record<string, any>): ScoreRowData {
|
|
|
19
19
|
return {
|
|
20
20
|
...row,
|
|
21
21
|
scorer: parseField(row.scorer),
|
|
22
|
-
|
|
22
|
+
preprocessStepResult: parseField(row.preprocessStepResult),
|
|
23
|
+
generateScorePrompt: row.generateScorePrompt,
|
|
24
|
+
generateReasonPrompt: row.generateReasonPrompt,
|
|
23
25
|
analyzeStepResult: parseField(row.analyzeStepResult),
|
|
24
26
|
metadata: parseField(row.metadata),
|
|
25
27
|
input: parseField(row.input),
|
|
@@ -65,9 +67,15 @@ export class ScoresUpstash extends ScoresStorage {
|
|
|
65
67
|
|
|
66
68
|
async getScoresByScorerId({
|
|
67
69
|
scorerId,
|
|
70
|
+
entityId,
|
|
71
|
+
entityType,
|
|
72
|
+
source,
|
|
68
73
|
pagination = { page: 0, perPage: 20 },
|
|
69
74
|
}: {
|
|
70
75
|
scorerId: string;
|
|
76
|
+
entityId?: string;
|
|
77
|
+
entityType?: string;
|
|
78
|
+
source?: ScoringSource;
|
|
71
79
|
pagination?: { page: number; perPage: number };
|
|
72
80
|
}): Promise<{
|
|
73
81
|
scores: ScoreRowData[];
|
|
@@ -87,7 +95,14 @@ export class ScoresUpstash extends ScoresStorage {
|
|
|
87
95
|
// Filter out nulls and by scorerId
|
|
88
96
|
const filtered = results
|
|
89
97
|
.map((row: any) => row as Record<string, any> | null)
|
|
90
|
-
.filter((row): row is Record<string, any> =>
|
|
98
|
+
.filter((row): row is Record<string, any> => {
|
|
99
|
+
if (!row || typeof row !== 'object') return false;
|
|
100
|
+
if (row.scorerId !== scorerId) return false;
|
|
101
|
+
if (entityId && row.entityId !== entityId) return false;
|
|
102
|
+
if (entityType && row.entityType !== entityType) return false;
|
|
103
|
+
if (source && row.source !== source) return false;
|
|
104
|
+
return true;
|
|
105
|
+
});
|
|
91
106
|
const total = filtered.length;
|
|
92
107
|
const { page, perPage } = pagination;
|
|
93
108
|
const start = page * perPage;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
serializeDate,
|
|
3
|
+
TABLE_MESSAGES,
|
|
4
|
+
TABLE_WORKFLOW_SNAPSHOT,
|
|
5
|
+
TABLE_EVALS,
|
|
6
|
+
TABLE_SCORERS,
|
|
7
|
+
} from '@mastra/core/storage';
|
|
2
8
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
3
9
|
|
|
4
10
|
export function ensureDate(value: any): Date | null {
|
|
@@ -42,6 +48,8 @@ export function processRecord(tableName: TABLE_NAMES, record: Record<string, any
|
|
|
42
48
|
});
|
|
43
49
|
} else if (tableName === TABLE_EVALS) {
|
|
44
50
|
key = getKey(tableName, { id: record.run_id });
|
|
51
|
+
} else if (tableName === TABLE_SCORERS) {
|
|
52
|
+
key = getKey(tableName, { runId: record.runId });
|
|
45
53
|
} else {
|
|
46
54
|
key = getKey(tableName, { id: record.id });
|
|
47
55
|
}
|
package/src/storage/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MastraMessageContentV2, MastraMessageV2 } from '@mastra/core/agent';
|
|
2
2
|
import type { StorageThreadType, MastraMessageV1 } from '@mastra/core/memory';
|
|
3
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
3
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
4
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
5
5
|
import type {
|
|
6
6
|
TABLE_NAMES,
|
|
@@ -216,6 +216,18 @@ export class UpstashStore extends MastraStorage {
|
|
|
216
216
|
return this.stores.memory.getMessages({ threadId, selectBy, format });
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
async getMessagesById({ messageIds, format }: { messageIds: string[]; format: 'v1' }): Promise<MastraMessageV1[]>;
|
|
220
|
+
async getMessagesById({ messageIds, format }: { messageIds: string[]; format?: 'v2' }): Promise<MastraMessageV2[]>;
|
|
221
|
+
async getMessagesById({
|
|
222
|
+
messageIds,
|
|
223
|
+
format,
|
|
224
|
+
}: {
|
|
225
|
+
messageIds: string[];
|
|
226
|
+
format?: 'v1' | 'v2';
|
|
227
|
+
}): Promise<MastraMessageV1[] | MastraMessageV2[]> {
|
|
228
|
+
return this.stores.memory.getMessagesById({ messageIds, format });
|
|
229
|
+
}
|
|
230
|
+
|
|
219
231
|
public async getMessagesPaginated(
|
|
220
232
|
args: StorageGetMessagesArg & {
|
|
221
233
|
format?: 'v1' | 'v2';
|
|
@@ -343,10 +355,16 @@ export class UpstashStore extends MastraStorage {
|
|
|
343
355
|
async getScoresByScorerId({
|
|
344
356
|
scorerId,
|
|
345
357
|
pagination,
|
|
358
|
+
entityId,
|
|
359
|
+
entityType,
|
|
360
|
+
source,
|
|
346
361
|
}: {
|
|
347
362
|
scorerId: string;
|
|
348
363
|
pagination: StoragePagination;
|
|
364
|
+
entityId?: string;
|
|
365
|
+
entityType?: string;
|
|
366
|
+
source?: ScoringSource;
|
|
349
367
|
}): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }> {
|
|
350
|
-
return this.stores.scores.getScoresByScorerId({ scorerId, pagination });
|
|
368
|
+
return this.stores.scores.getScoresByScorerId({ scorerId, pagination, entityId, entityType, source });
|
|
351
369
|
}
|
|
352
370
|
}
|
package/src/vector/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
1
2
|
import { MastraError, ErrorDomain, ErrorCategory } from '@mastra/core/error';
|
|
2
3
|
import { MastraVector } from '@mastra/core/vector';
|
|
3
4
|
import type {
|
|
@@ -43,7 +44,7 @@ export class UpstashVector extends MastraVector<UpstashVectorFilter> {
|
|
|
43
44
|
ids,
|
|
44
45
|
sparseVectors,
|
|
45
46
|
}: UpstashUpsertVectorParams): Promise<string[]> {
|
|
46
|
-
const generatedIds = ids || vectors.map(() =>
|
|
47
|
+
const generatedIds = ids || vectors.map(() => randomUUID());
|
|
47
48
|
|
|
48
49
|
const points = vectors.map((vector, index) => ({
|
|
49
50
|
id: generatedIds[index]!,
|
package/tsup.config.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'util';
|
|
1
|
+
import { generateTypes } from '@internal/types-builder';
|
|
3
2
|
import { defineConfig } from 'tsup';
|
|
4
3
|
|
|
5
|
-
const exec = promisify(spawn);
|
|
6
|
-
|
|
7
4
|
export default defineConfig({
|
|
8
5
|
entry: ['src/index.ts'],
|
|
9
6
|
format: ['esm', 'cjs'],
|
|
@@ -15,8 +12,6 @@ export default defineConfig({
|
|
|
15
12
|
},
|
|
16
13
|
sourcemap: true,
|
|
17
14
|
onSuccess: async () => {
|
|
18
|
-
await
|
|
19
|
-
stdio: 'inherit',
|
|
20
|
-
});
|
|
15
|
+
await generateTypes(process.cwd());
|
|
21
16
|
},
|
|
22
17
|
});
|