2026-08-31 19:51:17 +03:00
|
|
|
import type { GraphSnapshot } from "../core/contracts.ts";
|
|
|
|
|
import { foldStaleChats, graphSnapshot } from "../core/graph.ts";
|
2026-08-31 20:00:12 +03:00
|
|
|
import { stores } from "./stores.ts";
|
2026-08-31 19:51:17 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Server-side graph entry for the home view (GET /api/graph): fold any chat
|
|
|
|
|
* whose updatedAt outstrips its emission checkpoint first (partial sessions
|
|
|
|
|
* deposit value), then return the snapshot. Today the fold is the naive-union
|
|
|
|
|
* emission; the extraction-pipeline stage replaces the writer behind this
|
|
|
|
|
* same read surface.
|
|
|
|
|
*/
|
|
|
|
|
export function graphView(): GraphSnapshot {
|
2026-08-31 20:00:12 +03:00
|
|
|
foldStaleChats(stores);
|
|
|
|
|
return graphSnapshot(stores);
|
2026-08-31 19:51:17 +03:00
|
|
|
}
|