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

Function listSessionSummaries

demo/server/session-log.ts:63–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63function listSessionSummaries(): ReturnType<typeof summarizeSession>[] {
64 ensureSessionDir();
65 const summaries: NonNullable<ReturnType<typeof summarizeSession>>[] = [];
66
67 for (const name of fs.readdirSync(SESSION_DIR)) {
68 if (!name.endsWith(".json") || name === "current.json") {
69 continue;
70 }
71 const session = readSessionFile(path.join(SESSION_DIR, name));
72 const summary = session ? summarizeSession(session) : null;
73 if (summary) {
74 summaries.push(summary);
75 }
76 }
77
78 return summaries.sort(
79 (a, b) =>
80 new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(),
81 );
82}
83
84export function sessionLogPlugin(): Plugin {
85 return {

Callers 1

configureServerFunction · 0.85

Calls 3

ensureSessionDirFunction · 0.85
readSessionFileFunction · 0.85
summarizeSessionFunction · 0.85

Tested by

no test coverage detected