@mastra/memory 0.10.4 → 0.10.5-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 +10 -0
- package/dist/_tsup-dts-rollup.d.cts +10 -0
- package/dist/_tsup-dts-rollup.d.ts +10 -0
- package/dist/index.cjs +11 -0
- package/dist/index.js +11 -0
- package/package.json +2 -2
- package/src/index.ts +17 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/memory@0.10.
|
|
2
|
+
> @mastra/memory@0.10.5-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.10.
|
|
6
|
+
> @mastra/memory@0.10.5-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,15 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 0.10.5-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d8f2d19: Add updateMessages API to storage classes (only support for PG and LibSQL for now) and to memory class. Additionally allow for metadata to be saved in the content field of a message.
|
|
8
|
+
- Updated dependencies [d8f2d19]
|
|
9
|
+
- Updated dependencies [9d52b17]
|
|
10
|
+
- Updated dependencies [8ba1b51]
|
|
11
|
+
- @mastra/core@0.10.7-alpha.0
|
|
12
|
+
|
|
3
13
|
## 0.10.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -89,6 +89,16 @@ export declare class Memory extends MastraMemory {
|
|
|
89
89
|
defaultWorkingMemoryTemplate: string;
|
|
90
90
|
private getWorkingMemoryToolInstruction;
|
|
91
91
|
getTools(config?: MemoryConfig): Record<string, CoreTool>;
|
|
92
|
+
/**
|
|
93
|
+
* Updates the metadata of a list of messages
|
|
94
|
+
* @param messages - The list of messages to update
|
|
95
|
+
* @returns The list of updated messages
|
|
96
|
+
*/
|
|
97
|
+
updateMessages({ messages, }: {
|
|
98
|
+
messages: Partial<MastraMessageV2> & {
|
|
99
|
+
id: string;
|
|
100
|
+
}[];
|
|
101
|
+
}): Promise<MastraMessageV2[]>;
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
/**
|
|
@@ -89,6 +89,16 @@ export declare class Memory extends MastraMemory {
|
|
|
89
89
|
defaultWorkingMemoryTemplate: string;
|
|
90
90
|
private getWorkingMemoryToolInstruction;
|
|
91
91
|
getTools(config?: MemoryConfig): Record<string, CoreTool>;
|
|
92
|
+
/**
|
|
93
|
+
* Updates the metadata of a list of messages
|
|
94
|
+
* @param messages - The list of messages to update
|
|
95
|
+
* @returns The list of updated messages
|
|
96
|
+
*/
|
|
97
|
+
updateMessages({ messages, }: {
|
|
98
|
+
messages: Partial<MastraMessageV2> & {
|
|
99
|
+
id: string;
|
|
100
|
+
}[];
|
|
101
|
+
}): Promise<MastraMessageV2[]>;
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -530,6 +530,17 @@ Notes:
|
|
|
530
530
|
}
|
|
531
531
|
return {};
|
|
532
532
|
}
|
|
533
|
+
/**
|
|
534
|
+
* Updates the metadata of a list of messages
|
|
535
|
+
* @param messages - The list of messages to update
|
|
536
|
+
* @returns The list of updated messages
|
|
537
|
+
*/
|
|
538
|
+
async updateMessages({
|
|
539
|
+
messages
|
|
540
|
+
}) {
|
|
541
|
+
if (messages.length === 0) return [];
|
|
542
|
+
return this.storage.updateMessages({ messages });
|
|
543
|
+
}
|
|
533
544
|
};
|
|
534
545
|
|
|
535
546
|
exports.Memory = Memory;
|
package/dist/index.js
CHANGED
|
@@ -523,6 +523,17 @@ Notes:
|
|
|
523
523
|
}
|
|
524
524
|
return {};
|
|
525
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Updates the metadata of a list of messages
|
|
528
|
+
* @param messages - The list of messages to update
|
|
529
|
+
* @returns The list of updated messages
|
|
530
|
+
*/
|
|
531
|
+
async updateMessages({
|
|
532
|
+
messages
|
|
533
|
+
}) {
|
|
534
|
+
if (messages.length === 0) return [];
|
|
535
|
+
return this.storage.updateMessages({ messages });
|
|
536
|
+
}
|
|
526
537
|
};
|
|
527
538
|
|
|
528
539
|
export { Memory };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"typescript-eslint": "^8.34.0",
|
|
55
55
|
"vitest": "^3.2.3",
|
|
56
56
|
"@internal/lint": "0.0.13",
|
|
57
|
-
"@mastra/core": "0.10.
|
|
57
|
+
"@mastra/core": "0.10.7-alpha.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@mastra/core": ">=0.10.4-0 <0.11.0"
|
package/src/index.ts
CHANGED
|
@@ -703,4 +703,21 @@ Notes:
|
|
|
703
703
|
}
|
|
704
704
|
return {};
|
|
705
705
|
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Updates the metadata of a list of messages
|
|
709
|
+
* @param messages - The list of messages to update
|
|
710
|
+
* @returns The list of updated messages
|
|
711
|
+
*/
|
|
712
|
+
public async updateMessages({
|
|
713
|
+
messages,
|
|
714
|
+
}: {
|
|
715
|
+
messages: Partial<MastraMessageV2> & { id: string }[];
|
|
716
|
+
}): Promise<MastraMessageV2[]> {
|
|
717
|
+
if (messages.length === 0) return [];
|
|
718
|
+
|
|
719
|
+
// TODO: Possibly handle updating the vector db here when a message is updated.
|
|
720
|
+
|
|
721
|
+
return this.storage.updateMessages({ messages });
|
|
722
|
+
}
|
|
706
723
|
}
|