(agentId: string, images: string[])
| 350 | |
| 351 | // Update agent image memory (replaces entire array) |
| 352 | export async function updateAgentImageMemory(agentId: string, images: string[]): Promise<void> { |
| 353 | const db = await openDB(); |
| 354 | |
| 355 | const tx = db.transaction(IMAGE_MEMORY_STORE, 'readwrite'); |
| 356 | const store = tx.objectStore(IMAGE_MEMORY_STORE); |
| 357 | |
| 358 | await new Promise<void>((resolve, reject) => { |
| 359 | const request = store.put({ |
| 360 | id: agentId, |
| 361 | images |
| 362 | }); |
| 363 | request.onsuccess = () => resolve(); |
| 364 | request.onerror = () => reject(request.error); |
| 365 | }); |
| 366 | dispatchMemoryUpdate(agentId); |
| 367 | } |
| 368 | |
| 369 | // Append images to agent's image memory |
| 370 | export async function appendAgentImageMemory(agentId: string, images: string[]): Promise<void> { |
no test coverage detected