MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / estimateCacheBytes

Function estimateCacheBytes

app/src/modules/chat-cache.js:80–94  ·  view source on GitHub ↗
(record)

Source from the content-addressed store, hash-verified

78}
79
80export 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
96export async function pruneChatCache() {
97 let records;

Callers 2

persistSessionCacheFunction · 0.90
pruneChatCacheFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected