@mastra/upstash 0.10.1-alpha.0 → 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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/upstash@0.10.1-alpha.0 build /home/runner/work/mastra/mastra/stores/upstash
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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 11630ms
9
+ TSC ⚡️ Build success in 9175ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 12601ms
16
+ DTS ⚡️ Build success in 12964ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- CJS dist/index.cjs 32.04 KB
21
- CJS ⚡️ Build success in 1251ms
22
20
  ESM dist/index.js 31.90 KB
23
- ESM ⚡️ Build success in 1251ms
21
+ ESM ⚡️ Build success in 1534ms
22
+ CJS dist/index.cjs 32.04 KB
23
+ CJS ⚡️ Build success in 1534ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
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
+
12
+ ## 0.10.1
13
+
14
+ ### Patch Changes
15
+
16
+ - e60402a: Use scan instead of keys for upstash redis and implement batchInsert
17
+ - Updated dependencies [d70b807]
18
+ - Updated dependencies [6d16390]
19
+ - Updated dependencies [1e4a421]
20
+ - Updated dependencies [200d0da]
21
+ - Updated dependencies [bf5f17b]
22
+ - Updated dependencies [5343f93]
23
+ - Updated dependencies [38aee50]
24
+ - Updated dependencies [5c41100]
25
+ - Updated dependencies [d6a759b]
26
+ - Updated dependencies [6015bdf]
27
+ - @mastra/core@0.10.1
28
+
3
29
  ## 0.10.1-alpha.0
4
30
 
5
31
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/upstash",
3
- "version": "0.10.1-alpha.0",
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",
@@ -31,8 +31,8 @@
31
31
  "tsup": "^8.4.0",
32
32
  "typescript": "^5.8.2",
33
33
  "vitest": "^3.1.2",
34
- "@internal/lint": "0.0.6",
35
- "@mastra/core": "0.10.1-alpha.0"
34
+ "@internal/lint": "0.0.7",
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
  });
@@ -46,6 +46,8 @@ const createSampleWorkflowSnapshot = (status: string, createdAt?: Date) => {
46
46
  status: status,
47
47
  payload: {},
48
48
  error: undefined,
49
+ startedAt: timestamp.getTime(),
50
+ endedAt: new Date(timestamp.getTime() + 15000).getTime(),
49
51
  },
50
52
  input: {},
51
53
  } as WorkflowRunState['context'],
@@ -325,9 +327,9 @@ describe('UpstashStore', () => {
325
327
 
326
328
  await store.saveMessages({ messages: messages });
327
329
 
328
- const retrievedMessages = await store.getMessages<MessageType[]>({ threadId });
330
+ const retrievedMessages = await store.getMessages<MastraMessageV2[]>({ threadId });
329
331
  expect(retrievedMessages).toHaveLength(3);
330
- 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']);
331
333
  });
332
334
 
333
335
  it('should handle empty message array', async () => {
@@ -341,19 +343,21 @@ describe('UpstashStore', () => {
341
343
  id: 'msg-1',
342
344
  threadId,
343
345
  role: 'user',
344
- type: 'text',
345
- content: [
346
- { type: 'text', text: 'Message with' },
347
- { type: 'code', text: 'code block', language: 'typescript' },
348
- { type: 'text', text: 'and more text' },
349
- ],
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
+ },
350
354
  createdAt: new Date(),
351
355
  },
352
356
  ] as MessageType[];
353
357
 
354
358
  await store.saveMessages({ messages });
355
359
 
356
- const retrievedMessages = await store.getMessages<MessageType>({ threadId });
360
+ const retrievedMessages = await store.getMessages<MastraMessageV2>({ threadId });
357
361
  expect(retrievedMessages[0].content).toEqual(messages[0].content);
358
362
  });
359
363
  });
@@ -462,7 +466,13 @@ describe('UpstashStore', () => {
462
466
  const mockSnapshot = {
463
467
  value: { step1: 'completed' },
464
468
  context: {
465
- step1: { status: 'success', output: { result: 'done' } },
469
+ step1: {
470
+ status: 'success',
471
+ output: { result: 'done' },
472
+ payload: {},
473
+ startedAt: new Date().getTime(),
474
+ endedAt: new Date(Date.now() + 15000).getTime(),
475
+ },
466
476
  } as WorkflowRunState['context'],
467
477
  runId: testRunId,
468
478
  activePaths: [],