@mastra/memory 0.13.1 → 0.13.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,8 +1,8 @@
1
1
 
2
- > @mastra/memory@0.13.1-alpha.0 build /home/runner/work/mastra/mastra/packages/memory
2
+ > @mastra/memory@0.13.2-alpha.0 build /home/runner/work/mastra/mastra/packages/memory
3
3
  > pnpm run check && tsup --silent --config tsup.config.ts
4
4
 
5
5
 
6
- > @mastra/memory@0.13.1-alpha.0 check /home/runner/work/mastra/mastra/packages/memory
6
+ > @mastra/memory@0.13.2-alpha.0 check /home/runner/work/mastra/mastra/packages/memory
7
7
  > tsc --noEmit
8
8
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 0.13.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6933](https://github.com/mastra-ai/mastra/pull/6933) [`bf504a8`](https://github.com/mastra-ai/mastra/commit/bf504a833051f6f321d832cc7d631f3cb86d657b) Thanks [@NikAiyer](https://github.com/NikAiyer)! - Add util functions for workflow server handlers and made processor process function async
8
+
9
+ - Updated dependencies [[`0778757`](https://github.com/mastra-ai/mastra/commit/07787570e4addbd501522037bd2542c3d9e26822), [`bf504a8`](https://github.com/mastra-ai/mastra/commit/bf504a833051f6f321d832cc7d631f3cb86d657b), [`e6f5046`](https://github.com/mastra-ai/mastra/commit/e6f50467aff317e67e8bd74c485c3fbe2a5a6db1), [`9613558`](https://github.com/mastra-ai/mastra/commit/9613558e6475f4710e05d1be7553a32ee7bddc20)]:
10
+ - @mastra/core@0.14.2-alpha.0
11
+
3
12
  ## 0.13.1
4
13
 
5
14
  ### Patch Changes
@@ -1,5 +1,13 @@
1
1
  # @mastra/memory-integration-tests-v5
2
2
 
3
+ ## 0.1.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`0778757`](https://github.com/mastra-ai/mastra/commit/07787570e4addbd501522037bd2542c3d9e26822), [`bf504a8`](https://github.com/mastra-ai/mastra/commit/bf504a833051f6f321d832cc7d631f3cb86d657b), [`e6f5046`](https://github.com/mastra-ai/mastra/commit/e6f50467aff317e67e8bd74c485c3fbe2a5a6db1), [`9613558`](https://github.com/mastra-ai/mastra/commit/9613558e6475f4710e05d1be7553a32ee7bddc20)]:
8
+ - @mastra/core@0.14.2-alpha.0
9
+ - @mastra/memory@0.13.2-alpha.0
10
+
3
11
  ## 0.1.2
4
12
 
5
13
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mastra/memory-integration-tests-v5",
3
3
  "private": true,
4
- "version": "0.1.2",
4
+ "version": "0.1.3-alpha.0",
5
5
  "scripts": {
6
6
  "test": "pnpm test:streaming && pnpm test:working-memory && pnpm test:agent-memory && pnpm test:processors",
7
7
  "test:agent-memory": "vitest run ./src/agent-memory.test.ts",
@@ -230,11 +230,11 @@ describe('Agent Memory Tests', () => {
230
230
  }
231
231
 
232
232
  expect(flattenAssistantMessages(assistantMessages)).toEqual(
233
- expect.arrayContaining([expect.stringContaining('2 + 2'), expect.stringContaining('"result"')]),
233
+ expect.arrayContaining([expect.stringMatching(/2\s*\+\s*2/), expect.stringContaining('"result"')]),
234
234
  );
235
235
 
236
236
  expect(flattenAssistantMessages(assistantUiMessages)).toEqual(
237
- expect.arrayContaining([expect.stringContaining('2 + 2'), expect.stringContaining('"result"')]),
237
+ expect.arrayContaining([expect.stringMatching(/2\s*\+\s*2/), expect.stringContaining('"result"')]),
238
238
  );
239
239
  });
240
240
 
@@ -81,7 +81,7 @@ describe('Memory with Processors', () => {
81
81
  threadId: thread.id,
82
82
  selectBy: { last: 20 },
83
83
  });
84
- const result = memory.processMessages({
84
+ const result = await memory.processMessages({
85
85
  messages: new MessageList({ threadId: thread.id, resourceId })
86
86
  .add(queryResult.uiMessages, 'memory')
87
87
  .get.all.core(),
@@ -111,7 +111,7 @@ describe('Memory with Processors', () => {
111
111
  });
112
112
  expect(allMessagesQuery.messages.length).toBe(20);
113
113
 
114
- const allMessagesResult = memory.processMessages({
114
+ const allMessagesResult = await memory.processMessages({
115
115
  messages: new MessageList({ threadId: thread.id, resourceId })
116
116
  .add(allMessagesQuery.uiMessages, 'memory')
117
117
  .get.all.core(),
@@ -155,7 +155,7 @@ describe('Memory with Processors', () => {
155
155
  threadId: thread.id,
156
156
  selectBy: { last: 20 },
157
157
  });
158
- const result = memory.processMessages({
158
+ const result = await memory.processMessages({
159
159
  messages: v2ToCoreMessages(queryResult.uiMessages),
160
160
  processors: [new ToolCallFilter({ exclude: ['weather'] })],
161
161
  });
@@ -171,7 +171,10 @@ describe('Memory with Processors', () => {
171
171
  threadId: thread.id,
172
172
  selectBy: { last: 20 },
173
173
  });
174
- const result2 = memory.processMessages({ messages: v2ToCoreMessages(queryResult2.uiMessages), processors: [] });
174
+ const result2 = await memory.processMessages({
175
+ messages: v2ToCoreMessages(queryResult2.uiMessages),
176
+ processors: [],
177
+ });
175
178
  const messages2 = new MessageList({ threadId: thread.id, resourceId }).add(result2, 'response').get.all.v2();
176
179
  expect(new MessageList().add(messages2, 'memory').get.all.v2()).toHaveLength(messagesV2.length);
177
180
  expect(filterToolCallsByName(result2, 'weather')).toHaveLength(1);
@@ -184,7 +187,7 @@ describe('Memory with Processors', () => {
184
187
  threadId: thread.id,
185
188
  selectBy: { last: 20 },
186
189
  });
187
- const result3 = memory.processMessages({
190
+ const result3 = await memory.processMessages({
188
191
  messages: v2ToCoreMessages(queryResult3.uiMessages),
189
192
  processors: [new ToolCallFilter({ exclude: ['weather', 'calculator'] })],
190
193
  });
@@ -199,7 +202,7 @@ describe('Memory with Processors', () => {
199
202
  threadId: thread.id,
200
203
  selectBy: { last: 20 },
201
204
  });
202
- const result4 = memory.processMessages({
205
+ const result4 = await memory.processMessages({
203
206
  messages: v2ToCoreMessages(queryResult4.uiMessages),
204
207
  processors: [new ToolCallFilter()],
205
208
  });
@@ -234,7 +237,7 @@ describe('Memory with Processors', () => {
234
237
  threadId: thread.id,
235
238
  selectBy: { last: 20 },
236
239
  });
237
- const result = memory.processMessages({
240
+ const result = await memory.processMessages({
238
241
  messages: v2ToCoreMessages(queryResult.uiMessages),
239
242
  processors: [new ToolCallFilter({ exclude: ['weather'] }), new TokenLimiter(250)],
240
243
  });
@@ -420,7 +423,7 @@ describe('Memory with Processors', () => {
420
423
 
421
424
  const list = new MessageList({ threadId }).add(queryResult.messagesV2, 'memory');
422
425
 
423
- const baselineResult = memory.processMessages({
426
+ const baselineResult = await memory.processMessages({
424
427
  messages: list.get.remembered.core(),
425
428
  newMessages: list.get.input.core(),
426
429
  processors: [],
@@ -441,7 +444,7 @@ describe('Memory with Processors', () => {
441
444
  selectBy: { last: 20 },
442
445
  });
443
446
  const list2 = new MessageList({ threadId }).add(weatherQueryResult.messagesV2, 'memory');
444
- const weatherFilteredResult = memory.processMessages({
447
+ const weatherFilteredResult = await memory.processMessages({
445
448
  messages: list2.get.all.core(),
446
449
  processors: [new ToolCallFilter({ exclude: ['get_weather'] })],
447
450
  });
@@ -462,7 +465,7 @@ describe('Memory with Processors', () => {
462
465
  selectBy: { last: 20 },
463
466
  });
464
467
  const list3 = new MessageList({ threadId }).add(tokenLimitQuery.messages, 'memory');
465
- const tokenLimitedResult = memory.processMessages({
468
+ const tokenLimitedResult = await memory.processMessages({
466
469
  messages: list3.get.all.core(),
467
470
  processors: [new TokenLimiter(100)], // Small limit to only get a subset
468
471
  });
@@ -476,7 +479,7 @@ describe('Memory with Processors', () => {
476
479
  selectBy: { last: 20 },
477
480
  });
478
481
  const list4 = new MessageList({ threadId }).add(combinedQuery.messages, 'memory');
479
- const combinedResult = memory.processMessages({
482
+ const combinedResult = await memory.processMessages({
480
483
  messages: list4.get.all.core(),
481
484
  processors: [new ToolCallFilter({ exclude: ['get_weather', 'calculator'] }), new TokenLimiter(500)],
482
485
  });
@@ -529,7 +532,7 @@ describe('Memory with Processors', () => {
529
532
  });
530
533
 
531
534
  // Retrieve the message (no TokenLimiter, just get the message back)
532
- const result = memory.processMessages({
535
+ const result = await memory.processMessages({
533
536
  messages: v2ToCoreMessages(queryResult.uiMessages),
534
537
  });
535
538
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/memory",
3
- "version": "0.13.1",
3
+ "version": "0.13.2-alpha.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -58,9 +58,9 @@
58
58
  "typescript": "^5.8.3",
59
59
  "typescript-eslint": "^8.38.0",
60
60
  "vitest": "^3.2.4",
61
+ "@internal/types-builder": "0.0.6",
61
62
  "@internal/lint": "0.0.31",
62
- "@mastra/core": "0.14.1",
63
- "@internal/types-builder": "0.0.6"
63
+ "@mastra/core": "0.14.2-alpha.0"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@mastra/core": ">=0.14.0-0 <0.15.0-0"
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/mastra/mastra/packages/cli/dist/node_modules:/home/runner/work/mastra/mastra/packages/cli/node_modules:/home/runner/work/mastra/mastra/packages/node_modules:/home/runner/work/mastra/mastra/node_modules:/home/runner/work/mastra/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/home/runner/work/mastra/mastra/packages/cli/dist/node_modules:/home/runner/work/mastra/mastra/packages/cli/node_modules:/home/runner/work/mastra/mastra/packages/node_modules:/home/runner/work/mastra/mastra/node_modules:/home/runner/work/mastra/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../mastra/dist/index.js" "$@"
19
- else
20
- exec node "$basedir/../mastra/dist/index.js" "$@"
21
- fi