import { type LinkType, type MemoryKind } from "../constants.js"; import type { ProjectGraph } from "../types.js"; /** * Pure aggregation over a project's memory graph into the payload the * dashboard snippets render. Kept free of I/O so the numbers the MCP Apps * iframe shows are unit-testable without a daemon. */ export declare const ACTIVITY_WEEKS = 12; export declare const TOP_TAG_LIMIT = 12; export declare const TOP_CONNECTED_LIMIT = 5; /** Node cap for the graph snippet payload — keeps structuredContent bounded. */ export declare const GRAPH_NODE_LIMIT = 300; export interface ActivityWeek { /** ISO date (UTC midnight) of the first day of the bucket. */ start: string; created: number; updated: number; } export interface MemoryInsights { project: { id: number; name: string; }; generated_at: string; totals: { memories: number; links: number; distinct_tags: number; total_chars: number; }; by_kind: Array<{ kind: MemoryKind; count: number; }>; links_by_type: Array<{ type: LinkType; count: number; }>; top_tags: Array<{ tag: string; count: number; }>; /** * Oldest week first; 12 seven-day buckets aligned to UTC midnights, the * window ending at the first UTC midnight after `generated_at`. */ activity: ActivityWeek[]; top_connected: Array<{ id: number; name: string; kind: MemoryKind; degree: number; }>; orphan_count: number; freshest?: { id: number; name: string; kind: MemoryKind; updated_at: string; }; } export interface GraphPayload { project: { id: number; name: string; }; nodes: Array<{ id: number; name: string; kind: MemoryKind; tags: string[]; degree: number; }>; edges: Array<{ id: number; source: number; target: number; type: LinkType; }>; total_memories: number; total_links: number; truncated: boolean; } export declare function computeInsights(graph: ProjectGraph, now: Date): MemoryInsights; export declare function toGraphPayload(graph: ProjectGraph, nodeLimit?: number): GraphPayload; /** Text fallback: what the model (and any non-UI host) sees for memory_insights. */ export declare function renderInsightsText(insights: MemoryInsights): string; /** Text fallback for memory_graph — a summary, never the full node/edge dump. */ export declare function renderGraphText(payload: GraphPayload): string;