(agentId: string, memory: string)
| 301 | |
| 302 | // Update agent memory |
| 303 | export async function updateAgentMemory(agentId: string, memory: string): Promise<void> { |
| 304 | const db = await openDB(); |
| 305 | |
| 306 | const tx = db.transaction(MEMORY_STORE, 'readwrite'); |
| 307 | const store = tx.objectStore(MEMORY_STORE); |
| 308 | |
| 309 | await new Promise<void>((resolve, reject) => { |
| 310 | const request = store.put({ |
| 311 | id: agentId, |
| 312 | memory |
| 313 | }); |
| 314 | request.onsuccess = () => resolve(); |
| 315 | request.onerror = () => reject(request.error); |
| 316 | }); |
| 317 | dispatchMemoryUpdate(agentId); |
| 318 | } |
| 319 | |
| 320 | // Get agent image memory |
| 321 | export async function getAgentImageMemory(agentId: string): Promise<string[]> { |
no test coverage detected