@mastra/upstash 0.1.0-alpha.2 → 0.1.0-alpha.20

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 CHANGED
@@ -1,5 +1,163 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.1.0-alpha.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [016493a]
8
+ - Updated dependencies [382f4dc]
9
+ - Updated dependencies [176bc42]
10
+ - Updated dependencies [d68b532]
11
+ - Updated dependencies [fe3dcb0]
12
+ - Updated dependencies [e448a26]
13
+ - Updated dependencies [fd75f3c]
14
+ - Updated dependencies [ccf115c]
15
+ - Updated dependencies [a221426]
16
+ - @mastra/core@0.2.0-alpha.110
17
+
18
+ ## 0.1.0-alpha.19
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [d5fccfb]
23
+ - @mastra/core@0.2.0-alpha.109
24
+
25
+ ## 0.1.0-alpha.18
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [5ee67d3]
30
+ - Updated dependencies [95a4697]
31
+ - @mastra/core@0.2.0-alpha.108
32
+
33
+ ## 0.1.0-alpha.17
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [66a5392]
38
+ - @mastra/core@0.2.0-alpha.107
39
+
40
+ ## 0.1.0-alpha.16
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [6f2c0f5]
45
+ - Updated dependencies [a8a459a]
46
+ - @mastra/core@0.2.0-alpha.106
47
+
48
+ ## 0.1.0-alpha.15
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [1420ae2]
53
+ - Updated dependencies [99f1847]
54
+ - @mastra/core@0.2.0-alpha.105
55
+
56
+ ## 0.1.0-alpha.14
57
+
58
+ ### Patch Changes
59
+
60
+ - b97ca96: Tracing into default storage
61
+ - Updated dependencies [5fdc87c]
62
+ - Updated dependencies [b97ca96]
63
+ - Updated dependencies [72d1990]
64
+ - Updated dependencies [cf6d825]
65
+ - Updated dependencies [10870bc]
66
+ - @mastra/core@0.2.0-alpha.104
67
+
68
+ ## 0.1.0-alpha.13
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies [4534e77]
73
+ - @mastra/core@0.2.0-alpha.103
74
+
75
+ ## 0.1.0-alpha.12
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [a9345f9]
80
+ - @mastra/core@0.2.0-alpha.102
81
+
82
+ ## 0.1.0-alpha.11
83
+
84
+ ### Patch Changes
85
+
86
+ - 4f1d1a1: Enforce types ann cleanup package.json
87
+ - Updated dependencies [66a03ec]
88
+ - Updated dependencies [4f1d1a1]
89
+ - @mastra/core@0.2.0-alpha.101
90
+
91
+ ## 0.1.0-alpha.10
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [9d1796d]
96
+ - @mastra/core@0.2.0-alpha.100
97
+
98
+ ## 0.1.0-alpha.9
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [7d83b92]
103
+ - @mastra/core@0.2.0-alpha.99
104
+
105
+ ## 0.1.0-alpha.8
106
+
107
+ ### Patch Changes
108
+
109
+ - 70dabd9: Fix broken publish
110
+ - Updated dependencies [70dabd9]
111
+ - Updated dependencies [202d404]
112
+ - @mastra/core@0.2.0-alpha.98
113
+
114
+ ## 0.1.0-alpha.7
115
+
116
+ ### Patch Changes
117
+
118
+ - 07c069d: Update build script
119
+ - Updated dependencies [07c069d]
120
+ - Updated dependencies [7892533]
121
+ - Updated dependencies [e6d8055]
122
+ - Updated dependencies [5950de5]
123
+ - Updated dependencies [df843d3]
124
+ - Updated dependencies [a870123]
125
+ - @mastra/core@0.2.0-alpha.97
126
+
127
+ ## 0.1.0-alpha.6
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [74b3078]
132
+ - @mastra/core@0.2.0-alpha.96
133
+
134
+ ## 0.1.0-alpha.5
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [9fb59d6]
139
+ - @mastra/core@0.2.0-alpha.95
140
+
141
+ ## 0.1.0-alpha.4
142
+
143
+ ### Minor Changes
144
+
145
+ - 8b416d9: Breaking changes
146
+
147
+ ### Patch Changes
148
+
149
+ - 9c10484: update all packages
150
+ - Updated dependencies [9c10484]
151
+ - Updated dependencies [8b416d9]
152
+ - @mastra/core@0.2.0-alpha.94
153
+
154
+ ## 0.1.0-alpha.3
155
+
156
+ ### Patch Changes
157
+
158
+ - Updated dependencies [5285356]
159
+ - @mastra/core@0.2.0-alpha.93
160
+
3
161
  ## 0.1.0-alpha.2
4
162
 
5
163
  ### Minor Changes
@@ -0,0 +1,129 @@
1
+ import { BaseFilterTranslator } from '@mastra/core/filter';
2
+ import { EvalRow } from '@mastra/core/storage';
3
+ import { Filter } from '@mastra/core/filter';
4
+ import { MastraStorage } from '@mastra/core/storage';
5
+ import { MastraVector } from '@mastra/core/vector';
6
+ import { MessageType } from '@mastra/core/memory';
7
+ import { OperatorSupport } from '@mastra/core/filter';
8
+ import type { QueryResult } from '@mastra/core/vector';
9
+ import { StorageColumn } from '@mastra/core/storage';
10
+ import { StorageGetMessagesArg } from '@mastra/core/storage';
11
+ import { StorageThreadType } from '@mastra/core/memory';
12
+ import { TABLE_NAMES } from '@mastra/core/storage';
13
+ import { WorkflowRunState } from '@mastra/core/workflows';
14
+
15
+ declare interface UpstashConfig {
16
+ url: string;
17
+ token: string;
18
+ }
19
+ export { UpstashConfig }
20
+ export { UpstashConfig as UpstashConfig_alias_1 }
21
+
22
+ export declare class UpstashFilterTranslator extends BaseFilterTranslator {
23
+ protected getSupportedOperators(): OperatorSupport;
24
+ translate(filter?: Filter): string | undefined;
25
+ private translateNode;
26
+ private readonly COMPARISON_OPS;
27
+ private translateOperator;
28
+ private readonly NEGATED_OPERATORS;
29
+ private formatNot;
30
+ private formatValue;
31
+ private formatArray;
32
+ private formatComparison;
33
+ private joinConditions;
34
+ }
35
+
36
+ declare class UpstashStore extends MastraStorage {
37
+ batchInsert({ tableName, records }: {
38
+ tableName: TABLE_NAMES;
39
+ records: Record<string, any>[];
40
+ }): Promise<void>;
41
+ getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
42
+ getTraces({ name, scope, page, perPage, attributes, }: {
43
+ name?: string;
44
+ scope?: string;
45
+ page: number;
46
+ perPage: number;
47
+ attributes?: Record<string, string>;
48
+ }): Promise<any[]>;
49
+ private redis;
50
+ constructor(config: UpstashConfig);
51
+ private getKey;
52
+ private ensureDate;
53
+ private serializeDate;
54
+ createTable({ tableName, schema, }: {
55
+ tableName: TABLE_NAMES;
56
+ schema: Record<string, StorageColumn>;
57
+ }): Promise<void>;
58
+ clearTable({ tableName }: {
59
+ tableName: TABLE_NAMES;
60
+ }): Promise<void>;
61
+ insert({ tableName, record }: {
62
+ tableName: TABLE_NAMES;
63
+ record: Record<string, any>;
64
+ }): Promise<void>;
65
+ load<R>({ tableName, keys }: {
66
+ tableName: TABLE_NAMES;
67
+ keys: Record<string, string>;
68
+ }): Promise<R | null>;
69
+ getThreadById({ threadId }: {
70
+ threadId: string;
71
+ }): Promise<StorageThreadType | null>;
72
+ getThreadsByResourceId({ resourceId }: {
73
+ resourceId: string;
74
+ }): Promise<StorageThreadType[]>;
75
+ saveThread({ thread }: {
76
+ thread: StorageThreadType;
77
+ }): Promise<StorageThreadType>;
78
+ updateThread({ id, title, metadata, }: {
79
+ id: string;
80
+ title: string;
81
+ metadata: Record<string, unknown>;
82
+ }): Promise<StorageThreadType>;
83
+ deleteThread({ threadId }: {
84
+ threadId: string;
85
+ }): Promise<void>;
86
+ private getMessageKey;
87
+ private getThreadMessagesKey;
88
+ saveMessages({ messages }: {
89
+ messages: MessageType[];
90
+ }): Promise<MessageType[]>;
91
+ getMessages<T = unknown>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T[]>;
92
+ persistWorkflowSnapshot(params: {
93
+ namespace: string;
94
+ workflowName: string;
95
+ runId: string;
96
+ snapshot: WorkflowRunState;
97
+ }): Promise<void>;
98
+ loadWorkflowSnapshot(params: {
99
+ namespace: string;
100
+ workflowName: string;
101
+ runId: string;
102
+ }): Promise<WorkflowRunState | null>;
103
+ close(): Promise<void>;
104
+ }
105
+ export { UpstashStore }
106
+ export { UpstashStore as UpstashStore_alias_1 }
107
+
108
+ declare class UpstashVector extends MastraVector {
109
+ private client;
110
+ constructor({ url, token }: {
111
+ url: string;
112
+ token: string;
113
+ });
114
+ upsert(indexName: string, vectors: number[][], metadata?: Record<string, any>[], ids?: string[]): Promise<string[]>;
115
+ transformFilter(filter?: Filter): string | undefined;
116
+ createIndex(_indexName: string, _dimension: number, _metric?: 'cosine' | 'euclidean' | 'dotproduct'): Promise<void>;
117
+ query(indexName: string, queryVector: number[], topK?: number, filter?: Filter, includeVector?: boolean): Promise<QueryResult[]>;
118
+ listIndexes(): Promise<string[]>;
119
+ describeIndex(indexName: string): Promise<{
120
+ dimension: number;
121
+ count: number;
122
+ metric: "cosine" | "euclidean" | "dotproduct";
123
+ }>;
124
+ deleteIndex(indexName: string): Promise<void>;
125
+ }
126
+ export { UpstashVector }
127
+ export { UpstashVector as UpstashVector_alias_1 }
128
+
129
+ export { }
package/dist/index.d.ts CHANGED
@@ -1,88 +1,3 @@
1
- import { StorageThreadType, MessageType } from '@mastra/core/memory';
2
- import { MastraStorage, TABLE_NAMES, StorageColumn, StorageGetMessagesArg } from '@mastra/core/storage';
3
- import { WorkflowRunState } from '@mastra/core/workflows';
4
- import { Filter } from '@mastra/core/filter';
5
- import { MastraVector, QueryResult } from '@mastra/core/vector';
6
-
7
- interface UpstashConfig {
8
- url: string;
9
- token: string;
10
- }
11
- declare class UpstashStore extends MastraStorage {
12
- private redis;
13
- constructor(config: UpstashConfig);
14
- private getKey;
15
- private ensureDate;
16
- private serializeDate;
17
- createTable({ tableName, schema, }: {
18
- tableName: TABLE_NAMES;
19
- schema: Record<string, StorageColumn>;
20
- }): Promise<void>;
21
- clearTable({ tableName }: {
22
- tableName: TABLE_NAMES;
23
- }): Promise<void>;
24
- insert({ tableName, record }: {
25
- tableName: TABLE_NAMES;
26
- record: Record<string, any>;
27
- }): Promise<void>;
28
- load<R>({ tableName, keys }: {
29
- tableName: TABLE_NAMES;
30
- keys: Record<string, string>;
31
- }): Promise<R | null>;
32
- getThreadById({ threadId }: {
33
- threadId: string;
34
- }): Promise<StorageThreadType | null>;
35
- getThreadsByResourceId({ resourceId }: {
36
- resourceId: string;
37
- }): Promise<StorageThreadType[]>;
38
- saveThread({ thread }: {
39
- thread: StorageThreadType;
40
- }): Promise<StorageThreadType>;
41
- updateThread({ id, title, metadata, }: {
42
- id: string;
43
- title: string;
44
- metadata: Record<string, unknown>;
45
- }): Promise<StorageThreadType>;
46
- deleteThread({ threadId }: {
47
- threadId: string;
48
- }): Promise<void>;
49
- private getMessageKey;
50
- private getThreadMessagesKey;
51
- saveMessages({ messages }: {
52
- messages: MessageType[];
53
- }): Promise<MessageType[]>;
54
- getMessages<T = unknown>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T[]>;
55
- persistWorkflowSnapshot(params: {
56
- namespace: string;
57
- workflowName: string;
58
- runId: string;
59
- snapshot: WorkflowRunState;
60
- }): Promise<void>;
61
- loadWorkflowSnapshot(params: {
62
- namespace: string;
63
- workflowName: string;
64
- runId: string;
65
- }): Promise<WorkflowRunState | null>;
66
- close(): Promise<void>;
67
- }
68
-
69
- declare class UpstashVector extends MastraVector {
70
- private client;
71
- constructor({ url, token }: {
72
- url: string;
73
- token: string;
74
- });
75
- upsert(indexName: string, vectors: number[][], metadata?: Record<string, any>[], ids?: string[]): Promise<string[]>;
76
- transformFilter(filter?: Filter): string | undefined;
77
- createIndex(_indexName: string, _dimension: number, _metric?: 'cosine' | 'euclidean' | 'dotproduct'): Promise<void>;
78
- query(indexName: string, queryVector: number[], topK?: number, filter?: Filter, includeVector?: boolean): Promise<QueryResult[]>;
79
- listIndexes(): Promise<string[]>;
80
- describeIndex(indexName: string): Promise<{
81
- dimension: number;
82
- count: number;
83
- metric: "cosine" | "euclidean" | "dotproduct";
84
- }>;
85
- deleteIndex(indexName: string): Promise<void>;
86
- }
87
-
88
- export { type UpstashConfig, UpstashStore, UpstashVector };
1
+ export { UpstashConfig } from './_tsup-dts-rollup.js';
2
+ export { UpstashStore } from './_tsup-dts-rollup.js';
3
+ export { UpstashVector } from './_tsup-dts-rollup.js';
package/dist/index.js CHANGED
@@ -8,6 +8,21 @@ import { BaseFilterTranslator } from '@mastra/core/filter';
8
8
 
9
9
  // src/storage/index.ts
10
10
  var UpstashStore = class extends MastraStorage {
11
+ batchInsert({ tableName, records }) {
12
+ throw new Error("Method not implemented.");
13
+ }
14
+ getEvalsByAgentName(agentName, type) {
15
+ throw new Error("Method not implemented.");
16
+ }
17
+ getTraces({
18
+ name,
19
+ scope,
20
+ page,
21
+ perPage,
22
+ attributes
23
+ }) {
24
+ throw new Error("Method not implemented.");
25
+ }
11
26
  redis;
12
27
  constructor(config) {
13
28
  super({ name: "Upstash" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/upstash",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.20",
4
4
  "description": "Upstash provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,19 +17,20 @@
17
17
  "dependencies": {
18
18
  "@upstash/redis": "^1.28.3",
19
19
  "@upstash/vector": "^1.1.7",
20
- "@mastra/core": "^0.2.0-alpha.92"
20
+ "@mastra/core": "^0.2.0-alpha.110"
21
21
  },
22
22
  "devDependencies": {
23
- "@tsconfig/recommended": "^1.0.7",
24
- "@types/node": "^22.9.0",
23
+ "@microsoft/api-extractor": "^7.49.2",
24
+ "@types/node": "^22.13.1",
25
25
  "tsup": "^8.0.1",
26
+ "typescript": "^5.7.3",
26
27
  "vitest": "^3.0.4"
27
28
  },
28
29
  "scripts": {
29
30
  "pretest": "docker compose up -d",
30
31
  "test": "vitest run",
31
32
  "posttest": "docker compose down",
32
- "build": "tsup-node src/index.ts --format esm --dts --clean --treeshake",
33
- "dev": "tsup-node src/index.ts --format esm --dts --clean --treeshake --watch"
33
+ "build": "tsup src/index.ts --format esm --experimental-dts --clean --treeshake",
34
+ "build:watch": "pnpm build --watch"
34
35
  }
35
36
  }
@@ -1,5 +1,11 @@
1
1
  import { type StorageThreadType, type MessageType } from '@mastra/core/memory';
2
- import { MastraStorage, type TABLE_NAMES, type StorageColumn, type StorageGetMessagesArg } from '@mastra/core/storage';
2
+ import {
3
+ MastraStorage,
4
+ type TABLE_NAMES,
5
+ type StorageColumn,
6
+ type StorageGetMessagesArg,
7
+ type EvalRow,
8
+ } from '@mastra/core/storage';
3
9
  import { type WorkflowRunState } from '@mastra/core/workflows';
4
10
  import { Redis } from '@upstash/redis';
5
11
 
@@ -9,6 +15,27 @@ export interface UpstashConfig {
9
15
  }
10
16
 
11
17
  export class UpstashStore extends MastraStorage {
18
+ batchInsert({ tableName, records }: { tableName: TABLE_NAMES; records: Record<string, any>[] }): Promise<void> {
19
+ throw new Error('Method not implemented.');
20
+ }
21
+ getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]> {
22
+ throw new Error('Method not implemented.');
23
+ }
24
+ getTraces({
25
+ name,
26
+ scope,
27
+ page,
28
+ perPage,
29
+ attributes,
30
+ }: {
31
+ name?: string;
32
+ scope?: string;
33
+ page: number;
34
+ perPage: number;
35
+ attributes?: Record<string, string>;
36
+ }): Promise<any[]> {
37
+ throw new Error('Method not implemented.');
38
+ }
12
39
  private redis: Redis;
13
40
 
14
41
  constructor(config: UpstashConfig) {
@@ -1,4 +1,4 @@
1
- import { BaseFilterTranslator, Filter, FieldCondition, OperatorSupport } from '@mastra/core/filter';
1
+ import { BaseFilterTranslator, type Filter, type FieldCondition, type OperatorSupport } from '@mastra/core/filter';
2
2
 
3
3
  export class UpstashFilterTranslator extends BaseFilterTranslator {
4
4
  protected override getSupportedOperators(): OperatorSupport {
@@ -49,7 +49,6 @@ describe.skipIf(!process.env.UPSTASH_VECTOR_URL || !process.env.UPSTASH_VECTOR_T
49
49
  vectorStore = new UpstashVector({ url, token });
50
50
  });
51
51
 
52
-
53
52
  afterAll(async () => {
54
53
  if (!vectorStore) return;
55
54