File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,6 +155,19 @@ export const MemoryType = {
155155 CUSTOM : "custom" ,
156156} as const ;
157157
158+ export const createMessageMemory = ( params : Record < string , unknown > ) => {
159+ const now = Date . now ( ) ;
160+ return {
161+ ...params ,
162+ createdAt : now ,
163+ metadata : {
164+ type : MemoryType . MESSAGE ,
165+ timestamp : now ,
166+ scope : params . agentId ? "private" : "shared" ,
167+ } ,
168+ } ;
169+ } ;
170+
158171export type IAgentRuntime = unknown ;
159172export type Plugin = unknown ;
160173export type Action = unknown ;
@@ -196,6 +209,7 @@ const target = {
196209 getTokenForProvider,
197210 trimTokens,
198211 truncateToCompleteSentence,
212+ createMessageMemory,
199213} ;
200214
201215const proxy = new Proxy ( target , {
Original file line number Diff line number Diff line change 2727 "devDependencies" : {
2828 "@types/node" : " 22.19.17" ,
2929 "tsup" : " ^8.5.1" ,
30- "typescript" : " ^5.7.3 " ,
30+ "typescript" : " ^6.0.0 " ,
3131 "vitest" : " ^4.0.17"
3232 },
3333 "scripts" : {
You can’t perform that action at this time.
0 commit comments