/** * Presentation for the project graph — how nodes/subgraphs are rendered for the * model. Kept SEPARATE from the store (graphStore.ts) so it is pure and unit- * testable, and so Tier 1 (ranking / summaries / graph_search) can build on it. * * Two rules the model relies on: * - Truncation is EXPLICIT — an over-cap body ends with a pointer to the full * text; a token-budgeted subgraph reports what it omitted. Never a silent clip. * - Uncertainty is VISIBLE — unverified inferences and incident `contradicts` * edges are surfaced inline so a silently-conflicting fact can't slip past. */ import type { GraphNode, GraphEdge, GraphMap, SearchResult, TocResult } from './graphStore'; /** Max body chars shown inline before an explicit truncation pointer. */ export declare const BODY_CAP = 200; /** Default token budget for a rendered neighbourhood. */ export declare const DEFAULT_TOKEN_BUDGET = 1500; export interface Conflict { id: string; name: string; } type FmtNodeInput = Pick & Partial>; /** Extra summary presentation for {@link fmtNode} — a synthesized rollup and/or a staleness flag. */ export interface FmtOpts { /** A synthesized structural rollup to show when the node has no authored summary. */ summary?: string; /** True when `summary` above is a deterministic rollup, not authored (renders `≡~`). */ synthesized?: boolean; /** True when the node's AUTHORED summary is stale (superseded / gained children). */ stale?: boolean; } /** * One node as a compact, citable line. `conflicts` are the node's incident * `contradicts` edges (from {@link GraphStore.contradictionsFor}); when present * they are appended as `⚠ contradicts [id] "name"`. A summary — authored (`≡`) or * a synthesized structural rollup via `opts.summary` (`≡~`) — is preferred over the * body as the node's gist (Tier 1, item 3). */ export declare function fmtNode(n: FmtNodeInput, conflicts?: Conflict[], opts?: FmtOpts): string; /** * Render the cold-start anchor index (Tier 1, item 2): the connectivity hubs plus * the open questions, freshest decisions, and live contradictions — the "where do * I start" entry point an agent reads at task start. */ export declare function renderMap(m: GraphMap): string; /** * Render a graph_search bundle (Tier 1, item 4): a ranked, citable list. Each row * cites `[id]` with a one-line WHY — the matched terms and the edge-path from its * seed — plus contradiction / unverified-inference flags. Vectorless + explainable. */ export declare function renderSearch(res: SearchResult): string; export interface NeighborsResult { center: GraphNode; nodes: GraphNode[]; edges: GraphEdge[]; dist: Record; } /** Effective (authored or synthesized) summary of a node, for the full-detail line. */ export type EffSummary = { text: string; synthesized: boolean; } | undefined; export interface RenderNeighborsOpts { tokenBudget?: number; conflictsFor: (id: string) => Conflict[]; /** Pinned "core" nodes (item 4) — always prepended within budget, even off-neighbourhood. */ pinned?: GraphNode[]; /** Effective summary provider so a full line can show the authored/synthesized gist. */ effectiveSummaryFor?: (n: GraphNode) => EffSummary; /** Deterministic branch rollup (item 5) — used to collapse a branch that won't fit. */ rollupFor?: (id: string) => string | undefined; } /** * Render a bounded neighbourhood (Tier 2, item 4). Order: center → pinned core → * neighbours ranked by hop-proximity then recency. Fill to `tokenBudget`; when a * node won't fit, DEGRADE in tiers rather than silently drop — (a) body→name-only, * (b) substitute a branch's rollup summary for its members, (c) explicit * `…N more omitted`. Center + pinned nodes ALWAYS appear (degraded if need be). */ export declare function renderNeighbors(res: NeighborsResult, opts: RenderNeighborsOpts): string; /** * Render a navigable table-of-contents (Tier 2, item 2) as an indented outline — * the PageIndex-style text-stripped overview. Each line carries `[id]` to drill a * branch (`graph_toc root=`) and its one-line summary; over-cap children * collapse to `+K more`. */ export declare function renderToc(res: TocResult): string; export {};