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