(record)
| 78 | } |
| 79 | |
| 80 | export function estimateCacheBytes(record) { |
| 81 | const payload = JSON.stringify({ |
| 82 | sessionId: record.sessionId || '', |
| 83 | serverAddr: record.serverAddr || '', |
| 84 | html: record.html || '', |
| 85 | seenUuids: Array.isArray(record.seenUuids) ? record.seenUuids : [], |
| 86 | todoTasks: Array.isArray(record.todoTasks) ? record.todoTasks : [], |
| 87 | todoPanelOpen: !!record.todoPanelOpen, |
| 88 | cwd: record.cwd || '', |
| 89 | model: record.model || '', |
| 90 | lastSeq: record.lastSeq || 0, |
| 91 | updatedAt: record.updatedAt || 0, |
| 92 | }); |
| 93 | return payload.length; |
| 94 | } |
| 95 | |
| 96 | export async function pruneChatCache() { |
| 97 | let records; |
no outgoing calls
no test coverage detected