@mastra/upstash 0.10.1 → 0.10.2-alpha.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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +9 -0
- package/package.json +2 -2
- package/src/storage/upstash.test.ts +13 -11
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/upstash@0.10.
|
|
2
|
+
> @mastra/upstash@0.10.2-alpha.0 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.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 9175ms
|
|
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 12964ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
20
|
[32mESM[39m [1mdist/index.js [22m[32m31.90 KB[39m
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 1534ms
|
|
22
22
|
[32mCJS[39m [1mdist/index.cjs [22m[32m32.04 KB[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 1534ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/upstash
|
|
2
2
|
|
|
3
|
+
## 0.10.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e5dc18d: Added a backwards compatible layer to begin storing/retrieving UIMessages in storage instead of CoreMessages
|
|
8
|
+
- Updated dependencies [592a2db]
|
|
9
|
+
- Updated dependencies [e5dc18d]
|
|
10
|
+
- @mastra/core@0.10.2-alpha.0
|
|
11
|
+
|
|
3
12
|
## 0.10.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/upstash",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2-alpha.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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typescript": "^5.8.2",
|
|
33
33
|
"vitest": "^3.1.2",
|
|
34
34
|
"@internal/lint": "0.0.7",
|
|
35
|
-
"@mastra/core": "0.10.
|
|
35
|
+
"@mastra/core": "0.10.2-alpha.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@mastra/core": "^0.10.0"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'crypto';
|
|
2
|
+
import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
2
3
|
import type { MessageType } from '@mastra/core/memory';
|
|
3
4
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
4
5
|
import {
|
|
@@ -28,9 +29,8 @@ const createSampleThread = (date?: Date) => ({
|
|
|
28
29
|
const createSampleMessage = (threadId: string, content: string = 'Hello'): MessageType => ({
|
|
29
30
|
id: `msg-${randomUUID()}`,
|
|
30
31
|
role: 'user',
|
|
31
|
-
type: 'text',
|
|
32
32
|
threadId,
|
|
33
|
-
content: [{ type: 'text', text: content }],
|
|
33
|
+
content: { format: 2, parts: [{ type: 'text', text: content }] },
|
|
34
34
|
createdAt: new Date(),
|
|
35
35
|
resourceId: `resource-${randomUUID()}`,
|
|
36
36
|
});
|
|
@@ -327,9 +327,9 @@ describe('UpstashStore', () => {
|
|
|
327
327
|
|
|
328
328
|
await store.saveMessages({ messages: messages });
|
|
329
329
|
|
|
330
|
-
const retrievedMessages = await store.getMessages<
|
|
330
|
+
const retrievedMessages = await store.getMessages<MastraMessageV2[]>({ threadId });
|
|
331
331
|
expect(retrievedMessages).toHaveLength(3);
|
|
332
|
-
expect(retrievedMessages.map((m: any) => m.content[0].text)).toEqual(['First', 'Second', 'Third']);
|
|
332
|
+
expect(retrievedMessages.map((m: any) => m.content.parts[0].text)).toEqual(['First', 'Second', 'Third']);
|
|
333
333
|
});
|
|
334
334
|
|
|
335
335
|
it('should handle empty message array', async () => {
|
|
@@ -343,19 +343,21 @@ describe('UpstashStore', () => {
|
|
|
343
343
|
id: 'msg-1',
|
|
344
344
|
threadId,
|
|
345
345
|
role: 'user',
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
346
|
+
content: {
|
|
347
|
+
format: 2,
|
|
348
|
+
parts: [
|
|
349
|
+
{ type: 'text', text: 'Message with' },
|
|
350
|
+
{ type: 'code', text: 'code block', language: 'typescript' },
|
|
351
|
+
{ type: 'text', text: 'and more text' },
|
|
352
|
+
],
|
|
353
|
+
},
|
|
352
354
|
createdAt: new Date(),
|
|
353
355
|
},
|
|
354
356
|
] as MessageType[];
|
|
355
357
|
|
|
356
358
|
await store.saveMessages({ messages });
|
|
357
359
|
|
|
358
|
-
const retrievedMessages = await store.getMessages<
|
|
360
|
+
const retrievedMessages = await store.getMessages<MastraMessageV2>({ threadId });
|
|
359
361
|
expect(retrievedMessages[0].content).toEqual(messages[0].content);
|
|
360
362
|
});
|
|
361
363
|
});
|