import { type FlatRow, type FoldState, type SubtreeActivity } from './nav-render.js'; import type { NodeMeta, SubscriptionRef } from './index.js'; export { PI_MAX_WIDGET_LINES, VIEWPORT_FALLBACK_ROWS, ESC, RESET, BOLD, DIM, REVERSE, BG_ATTACHED, GREEN, RED, YELLOW, CYAN, GRAY, nodeGlyph, visibleWidth, truncate, fillWidth, fillBar, readTelemetry, fmtTokens, tokensCell, activityCell, cycleBadge, navLabel, shortId, askBadge, liveBelowBadge, isAttached, hasBrokerViewers, fetchAsksMap, graphWidgetBudget, GRAPH_HINT, type Telemetry, type FlatRow, type FoldState, type SubtreeActivity, } from './nav-render.js'; export declare function beginFrame(): void; /** getNode memoized for the current frame (meta.json read + sqlite row). */ export declare function cNode(id: string): NodeMeta | null; /** subscriptionsOf (a node's reports) memoized for the current frame. */ export declare function cSubscriptions(id: string): SubscriptionRef[]; /** subscribersOf (a node's managers) memoized for the current frame. */ export declare function cSubscribers(id: string): SubscriptionRef[]; /** First manager (by created) — the UP step for the ancestry spine. */ export declare function managerOf(id: string): string | undefined; /** A kind:'human' node is a control-plane ASK (a humanloop deck on the human's * screen), NOT a pi conversation — it has no session, so focusing/reviving it * boots a confused blank "you have been revived" pi. Its pending-ask signal * already rides the ⚑ badge on the ASKING node (attention.ts follows the * bridge node's parent relation), so the row carries no signal of its * own. Drop it from every navigable list (the tree, BASE reports, child counts, * subtree expansion) so it can never be selected. */ export declare function isHumanAsk(id: string): boolean; /** A node's direct children that are navigable conversations — human-ask nodes * dropped. The one place the nav chrome enumerates children. */ export declare function convoChildIds(id: string): string[]; /** Live reports (active|idle) of a node — the DOWN set in BASE. */ export declare function liveReports(id: string): string[]; /** Direct navigable children — used for the ⤳ badge (human-ask nodes excluded, * so the count matches what the tree actually shows). */ export declare function childCount(id: string): number; /** Climb first-manager edges from `self` to the ancestry root (cycle-guarded). */ export declare function climbRoot(self: string): string; /** Space-joined ids of a node's subtree (cursor-relative {subtree} var). */ export declare function subtreeIds(root: string): string[]; /** ⤳M direct-children badge — the single child-count signal, shown on any row * with navigable children (folded or not). In GRAPH the ▸ caret separately marks * a collapsed row, so this stays a pure count and never doubles as a fold badge. */ export declare function childBadge(node: NodeMeta | null): string; /** Sort rank for sibling ordering — live nodes (active, then idle) ahead of * terminal ones, so sessions still running surface at the TOP of each child * group instead of being buried under finished/failed ones. */ export declare function statusRank(id: string): number; /** Direct children, live-first — the sibling order used both when flattening * the tree and when stepping into a subtree (`l`). Array.sort is stable, so * equal-status siblings keep their creation order. */ export declare function sortedChildIds(id: string): string[]; export declare function computeSubtreeActivity(root: string, self: string): SubtreeActivity; /** Fold policy alone — thin wrapper over computeSubtreeActivity for the keypress * path (buildGraphModel without a precomputed set). The render path computes the * activity once and threads `expand` in, so it never recomputes here. */ export declare function computeDefaultExpanded(root: string, self: string): Set; export declare function buildGraphModel(self: string, folds: FoldState, expand?: ReadonlySet): FlatRow[]; /** Render one GRAPH row. CURSOR (selected) → reverse-video bar; an ATTACHED * (human-watched) node → a coloured background bar; SELF → bold name. The * cursor outranks the attached tint when both land on the same row. The * overlay-aware glyph alone carries the live signal (status / ⟳ / ⚠). */ export declare function renderGraphRow(r: FlatRow, isCursor: boolean, focused: ReadonlySet, activeBelow: ReadonlyMap, asks: Record): string;