memory view in chat client

This commit is contained in:
Storme-bit
2026-04-17 19:50:13 -07:00
parent 05f1fbb04e
commit b3fb936494
3 changed files with 187 additions and 0 deletions
@@ -219,4 +219,21 @@ export async function updateSessionProject(sessionId, projectId) {
});
if (!res.ok) throw new Error(`Failed to update session project: ${res.status}`);
return res.json();
}
export async function getEpisodes({ limit = 50, offset = 0, sessionId, q } = {}) {
const url = new URL(`${BASE}/episodes`);
url.searchParams.set('limit', limit);
url.searchParams.set('offset', offset);
if (sessionId) url.searchParams.set('sessionId', sessionId);
if (q) url.searchParams.set('q', q);
const res = await fetch(url.toString());
if (!res.ok) throw new Error(`Failed to fetch episodes: ${res.status}`);
return res.json(); // { episodes, total }
}
export async function deleteEpisode(id) {
const res = await fetch(`${BASE}/episodes/${id}`, { method: 'DELETE' });
if (!res.ok) throw new Error(`Failed to delete episode: ${res.status}`);
}