/** * The `/plugins` browser: the running agent's Harness preset composition. * * A bounded overlay, like Connect, Sessions, Work, and Todos: the committed * transcript under it is never rewritten, and closing it leaves the terminal * exactly as it was. One list, not two sections like Connect — a * composition is already one flat, ordered thing once nested groups are * flattened by `composition.ts`, so splitting it into categories here would * be inventing a grouping Harness's own file does not draw. * * Everything a keystroke here can do is decided by `model.ts` and carried * out by `actions.ts`; this module only draws the state it is handed and * reports the intent — `toggle`, `pickPreset`, `makeDefault` — back to its * owner (`index.ts`), the same division `connect/overlay.ts` keeps between * drawing a row and deciding what pressing something on it means. * @module dshline/plugins/overlay */ import type { TuiOverlay } from '../slots.ts'; import type { CompositionRow } from './composition.ts'; import type { PluginsState } from './catalog.ts'; /** What the browser needs from its owner. */ export interface PluginsOverlaySpec { /** The current reading of Harness's preset roster and composition. */ readonly state: () => PluginsState; /** Re-read every surface. */ readonly refresh: () => void; /** Enable or disable the selected composition row. */ readonly toggle: (row: CompositionRow) => void; /** Open the agent-preset picker. */ readonly pickPreset: () => void; /** Make the browsed preset the default for new sessions. */ readonly makeDefault: () => void; /** Current time, injected so notice expiry is assertable. */ readonly now: () => number; /** Remove this overlay from the live region. */ readonly close: () => void; /** Redraw after a move, an edit, or a landed read. */ readonly invalidate: () => void; } /** The Plugins overlay, plus the one thing its owner pushes back into it. */ export interface PluginsOverlay extends TuiOverlay { /** * Show a result over the list. * @param text - the sentence to show. * @param failed - whether it reports a refusal. */ report(text: string, failed: boolean): void; /** * Whether the reader has already closed the browser. * * An action holds its own awaits — a file write, a Harness re-resolve — and * can land after `esc` has come down, so its owner needs to tell "report * this where the reader is looking" from "the reader is no longer there". * @returns true once this overlay has closed. */ closed(): boolean; } /** * Create the `/plugins` browser overlay. * @param spec - the reading, the action intents, and overlay controls. * @returns a temporary live-region overlay that never writes the transcript. */ export declare function createPluginsOverlay(spec: PluginsOverlaySpec): PluginsOverlay; //# sourceMappingURL=overlay.d.ts.map