/** * Bounded live-region inspector for the model's current context. * * Two stages of one frame, like Work: the overview answers "how full is it, * and what is it made of", and an entry answers "what is this thing, and why * is it big". Nothing is committed — the transcript underneath stays in the * terminal's own scrollback and is never rewritten. * * Every figure on screen is labelled with the precision its authority claims. * Occupancy is upstream's `projectedTokens` — what the next request's prompt * would cost — and is labelled `projected`, once, rather than switching a `~` * on and off from an equality that cannot prove what it appeared to prove. * Composition and per-entry prices are the meter's fixed estimator throughout * and are marked `~` always. The two vocabularies are never divided into one * another: composition shares divide the composition total, and entry shares * divide the measured MESSAGE surface — which is what their labels say. * @module dshline/context/overlay */ import type { SessionSeq } from '@deepseek-ai/dsh-session'; import type { TuiOverlay } from '../slots.ts'; import type { ContextPreview, ContextReading, ContextSurvey } from './model.ts'; /** Inputs the context inspector needs from its owner. */ export interface ContextOverlaySpec { /** The cheap projection reading, read fresh on every paint. */ readonly reading: () => ContextReading; /** The expensive per-node survey; the surveyor decides when to remeasure. */ readonly survey: () => ContextSurvey; /** One entry's bounded content, asked for only while that entry is open. */ readonly preview: (seq: SessionSeq) => ContextPreview; /** The model's context window as the selected route advertises it. */ readonly capacity: () => number | undefined; /** * Whether the running agent currently has a registered `/compact` command. * * This stays a getter rather than a snapshot: Harness can register or remove * scoped commands while an overlay is open, and the footer must not advertise * a control that no longer resolves. * @returns whether the command is currently available. */ readonly canCompact: () => boolean; /** * Run the REGISTERED Harness `/compact` command. * * dshline never registers a `/compact` of its own and never calls * `ctx.compaction`: this dispatches the same command a typed line does. The * owner returns a problem for the overlay while the command lifecycle remains * the durable transcript authority underneath it. * @returns a message when the request failed, else nothing. */ readonly compact: () => Promise; /** Remove this temporary overlay. */ readonly close: () => void; /** Redraw after a keystroke, a spinner tick, or a settled action. */ readonly invalidate: () => void; } /** * Create the bounded context inspector. * @param spec - readings, the optional compaction command, and overlay controls. * @returns a live-region overlay that never writes the transcript. */ export declare function createContextOverlay(spec: ContextOverlaySpec): TuiOverlay; //# sourceMappingURL=overlay.d.ts.map