MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / normalizeSession

Function normalizeSession

demo/chat/session-api.ts:11–20  ·  view source on GitHub ↗
(raw: ChatSession)

Source from the content-addressed store, hash-verified

9}
10
11function normalizeSession(raw: ChatSession): ChatSession {
12 return repairSession({
13 ...raw,
14 messages: raw.messages.map((m) => ({
15 ...m,
16 content: typeof m.content === "string" ? m.content : "",
17 reasoning: typeof m.reasoning === "string" ? m.reasoning : undefined,
18 })),
19 });
20}
21
22export async function listSessions(): Promise<SessionSummary[]> {
23 try {

Callers 1

loadSessionByIdFunction · 0.85

Calls 1

repairSessionFunction · 0.90

Tested by

no test coverage detected