(memory: HubMemoryRecord)
| 2602 | // ─── Hub Shared Memories (independent) ─── |
| 2603 | |
| 2604 | upsertHubMemory(memory: HubMemoryRecord): void { |
| 2605 | this.db.prepare(` |
| 2606 | INSERT INTO hub_memories (id, source_chunk_id, source_user_id, source_agent, role, content, summary, kind, group_id, visibility, created_at, updated_at) |
| 2607 | VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |
| 2608 | ON CONFLICT(source_user_id, source_chunk_id) DO UPDATE SET |
| 2609 | source_agent = excluded.source_agent, |
| 2610 | role = excluded.role, |
| 2611 | content = excluded.content, |
| 2612 | summary = excluded.summary, |
| 2613 | kind = excluded.kind, |
| 2614 | group_id = excluded.group_id, |
| 2615 | visibility = excluded.visibility, |
| 2616 | created_at = excluded.created_at, |
| 2617 | updated_at = excluded.updated_at |
| 2618 | `).run(memory.id, memory.sourceChunkId, memory.sourceUserId, memory.sourceAgent, memory.role, memory.content, memory.summary, memory.kind, memory.groupId, memory.visibility, memory.createdAt, memory.updatedAt); |
| 2619 | } |
| 2620 | |
| 2621 | getHubMemoryBySource(sourceUserId: string, sourceChunkId: string): HubMemoryRecord | null { |
| 2622 | const row = this.db.prepare('SELECT * FROM hub_memories WHERE source_user_id = ? AND source_chunk_id = ?').get(sourceUserId, sourceChunkId) as HubMemoryRow | undefined; |
no test coverage detected