@mastra/memory 0.11.4 → 0.11.6-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 +2 -2
- package/CHANGELOG.md +26 -0
- package/dist/index.cjs +3 -1
- package/dist/index.js +3 -1
- package/package.json +6 -6
- package/src/index.ts +6 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/memory@0.11.
|
|
2
|
+
> @mastra/memory@0.11.6-alpha.0 build /home/runner/work/mastra/mastra/packages/memory
|
|
3
3
|
> pnpm run check && tsup --silent src/index.ts src/processors/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @mastra/memory@0.11.
|
|
6
|
+
> @mastra/memory@0.11.6-alpha.0 check /home/runner/work/mastra/mastra/packages/memory
|
|
7
7
|
> tsc --noEmit
|
|
8
8
|
|
|
9
9
|
Analysis will use the bundled TypeScript version 5.8.3
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 0.11.6-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 674a348: dependencies updates:
|
|
8
|
+
- Updated dependency [`@upstash/redis@^1.35.1` ↗︎](https://www.npmjs.com/package/@upstash/redis/v/1.35.1) (from `^1.35.0`, in `dependencies`)
|
|
9
|
+
- ad8a1d8: Fix inheriting storage from Mastra instance in Memory
|
|
10
|
+
- Updated dependencies [510e2c8]
|
|
11
|
+
- Updated dependencies [2f72fb2]
|
|
12
|
+
- Updated dependencies [3f89307]
|
|
13
|
+
- Updated dependencies [9eda7d4]
|
|
14
|
+
- Updated dependencies [9d49408]
|
|
15
|
+
- Updated dependencies [2ecf658]
|
|
16
|
+
- Updated dependencies [7a7754f]
|
|
17
|
+
- Updated dependencies [fc92d80]
|
|
18
|
+
- Updated dependencies [23a6a7c]
|
|
19
|
+
- Updated dependencies [09bca64]
|
|
20
|
+
- @mastra/core@0.12.0-alpha.0
|
|
21
|
+
|
|
22
|
+
## 0.11.5
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- ce088f5: Update all peerdeps to latest core
|
|
27
|
+
- @mastra/core@0.11.1
|
|
28
|
+
|
|
3
29
|
## 0.11.4
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -113,7 +113,6 @@ var Memory = class extends memory.MastraMemory {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
this.threadConfig = mergedConfig;
|
|
116
|
-
this.checkStorageFeatureSupport(mergedConfig);
|
|
117
116
|
}
|
|
118
117
|
async validateThreadIsOwnedByResource(threadId, resourceId) {
|
|
119
118
|
const thread = await this.storage.getThreadById({ threadId });
|
|
@@ -283,6 +282,7 @@ var Memory = class extends memory.MastraMemory {
|
|
|
283
282
|
if (!config.workingMemory?.enabled) {
|
|
284
283
|
throw new Error("Working memory is not enabled for this memory instance");
|
|
285
284
|
}
|
|
285
|
+
this.checkStorageFeatureSupport(config);
|
|
286
286
|
const scope = config.workingMemory.scope || "thread";
|
|
287
287
|
if (scope === "resource" && resourceId) {
|
|
288
288
|
await this.storage.updateResource({
|
|
@@ -319,6 +319,7 @@ var Memory = class extends memory.MastraMemory {
|
|
|
319
319
|
if (!config.workingMemory?.enabled) {
|
|
320
320
|
throw new Error("Working memory is not enabled for this memory instance");
|
|
321
321
|
}
|
|
322
|
+
this.checkStorageFeatureSupport(config);
|
|
322
323
|
const mutexKey = memoryConfig?.workingMemory?.scope === `resource` ? `resource-${resourceId}` : `thread-${threadId}`;
|
|
323
324
|
const mutex = this.updateWorkingMemoryMutexes.has(mutexKey) ? this.updateWorkingMemoryMutexes.get(mutexKey) : new asyncMutex.Mutex();
|
|
324
325
|
this.updateWorkingMemoryMutexes.set(mutexKey, mutex);
|
|
@@ -569,6 +570,7 @@ ${workingMemory}`;
|
|
|
569
570
|
if (!config.workingMemory?.enabled) {
|
|
570
571
|
return null;
|
|
571
572
|
}
|
|
573
|
+
this.checkStorageFeatureSupport(config);
|
|
572
574
|
const scope = config.workingMemory.scope || "thread";
|
|
573
575
|
let workingMemoryData = null;
|
|
574
576
|
if (scope === "resource" && resourceId) {
|
package/dist/index.js
CHANGED
|
@@ -106,7 +106,6 @@ var Memory = class extends MastraMemory {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
this.threadConfig = mergedConfig;
|
|
109
|
-
this.checkStorageFeatureSupport(mergedConfig);
|
|
110
109
|
}
|
|
111
110
|
async validateThreadIsOwnedByResource(threadId, resourceId) {
|
|
112
111
|
const thread = await this.storage.getThreadById({ threadId });
|
|
@@ -276,6 +275,7 @@ var Memory = class extends MastraMemory {
|
|
|
276
275
|
if (!config.workingMemory?.enabled) {
|
|
277
276
|
throw new Error("Working memory is not enabled for this memory instance");
|
|
278
277
|
}
|
|
278
|
+
this.checkStorageFeatureSupport(config);
|
|
279
279
|
const scope = config.workingMemory.scope || "thread";
|
|
280
280
|
if (scope === "resource" && resourceId) {
|
|
281
281
|
await this.storage.updateResource({
|
|
@@ -312,6 +312,7 @@ var Memory = class extends MastraMemory {
|
|
|
312
312
|
if (!config.workingMemory?.enabled) {
|
|
313
313
|
throw new Error("Working memory is not enabled for this memory instance");
|
|
314
314
|
}
|
|
315
|
+
this.checkStorageFeatureSupport(config);
|
|
315
316
|
const mutexKey = memoryConfig?.workingMemory?.scope === `resource` ? `resource-${resourceId}` : `thread-${threadId}`;
|
|
316
317
|
const mutex = this.updateWorkingMemoryMutexes.has(mutexKey) ? this.updateWorkingMemoryMutexes.get(mutexKey) : new Mutex();
|
|
317
318
|
this.updateWorkingMemoryMutexes.set(mutexKey, mutex);
|
|
@@ -562,6 +563,7 @@ ${workingMemory}`;
|
|
|
562
563
|
if (!config.workingMemory?.enabled) {
|
|
563
564
|
return null;
|
|
564
565
|
}
|
|
566
|
+
this.checkStorageFeatureSupport(config);
|
|
565
567
|
const scope = config.workingMemory.scope || "thread";
|
|
566
568
|
let workingMemoryData = null;
|
|
567
569
|
if (scope === "resource" && resourceId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "Apache-2.0",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@upstash/redis": "^1.35.
|
|
35
|
+
"@upstash/redis": "^1.35.1",
|
|
36
36
|
"ai": "^4.3.16",
|
|
37
37
|
"js-tiktoken": "^1.0.20",
|
|
38
38
|
"json-schema": "^0.4.0",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"eslint": "^9.30.1",
|
|
55
55
|
"tsup": "^8.5.0",
|
|
56
56
|
"typescript": "^5.8.3",
|
|
57
|
-
"typescript-eslint": "^8.
|
|
57
|
+
"typescript-eslint": "^8.38.0",
|
|
58
58
|
"vitest": "^3.2.4",
|
|
59
|
-
"@internal/lint": "0.0.
|
|
60
|
-
"@mastra/core": "0.
|
|
59
|
+
"@internal/lint": "0.0.23",
|
|
60
|
+
"@mastra/core": "0.12.0-alpha.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@mastra/core": ">=0.10.9-0 <0.
|
|
63
|
+
"@mastra/core": ">=0.10.9-0 <0.12.0-0"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"check": "tsc --noEmit",
|
package/src/index.ts
CHANGED
|
@@ -42,8 +42,6 @@ export class Memory extends MastraMemory {
|
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
this.threadConfig = mergedConfig;
|
|
45
|
-
|
|
46
|
-
this.checkStorageFeatureSupport(mergedConfig);
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
protected async validateThreadIsOwnedByResource(threadId: string, resourceId: string) {
|
|
@@ -294,6 +292,8 @@ export class Memory extends MastraMemory {
|
|
|
294
292
|
throw new Error('Working memory is not enabled for this memory instance');
|
|
295
293
|
}
|
|
296
294
|
|
|
295
|
+
this.checkStorageFeatureSupport(config);
|
|
296
|
+
|
|
297
297
|
const scope = config.workingMemory.scope || 'thread';
|
|
298
298
|
|
|
299
299
|
if (scope === 'resource' && resourceId) {
|
|
@@ -343,6 +343,8 @@ export class Memory extends MastraMemory {
|
|
|
343
343
|
throw new Error('Working memory is not enabled for this memory instance');
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
this.checkStorageFeatureSupport(config);
|
|
347
|
+
|
|
346
348
|
// If the agent calls the update working memory tool multiple times simultaneously
|
|
347
349
|
// each call could overwrite the other call
|
|
348
350
|
// so get an in memory mutex to make sure this.getWorkingMemory() returns up to date data each time
|
|
@@ -705,6 +707,8 @@ export class Memory extends MastraMemory {
|
|
|
705
707
|
return null;
|
|
706
708
|
}
|
|
707
709
|
|
|
710
|
+
this.checkStorageFeatureSupport(config);
|
|
711
|
+
|
|
708
712
|
const scope = config.workingMemory.scope || 'thread';
|
|
709
713
|
let workingMemoryData: string | null = null;
|
|
710
714
|
|