/** * `/theme`: choose the palette, and show what it did. * * Two things about this frontend make a theme picker unusual, and both are * terminal-model consequences rather than gaps to fill in later. * * The first is that finished rows are committed to the user's real scrollback * and are never rewritten. Switching palette repaints the bounded live region; * everything above it keeps the colours it was printed with, permanently. That * is the invariant the whole renderer is built on, so the command says so rather * than letting a reader conclude the switch half-failed. * * The second follows from the first. A picker cannot preview a palette by * repainting the transcript, so applying one is confirmed by a single line drawn * in the palette just installed — enough to see that something changed, and the * whole live region below it is redrawn anyway. An earlier version committed a * sample transcript instead: a fabricated reply, tool call, diff, and failure, * written permanently into the reader's scrollback and indistinguishable * afterwards from output a session actually produced. A theme is not worth * putting fiction in the record for. * @module dshline/themes */ import type { Context } from '@deepseek-ai/cordis'; import type { ColorDepth, Palette } from '@dshline/renderer'; /** * The values `/theme` accepts, for completing its argument. * @returns each shipped theme's id, with its description beside it. */ export declare function themeValues(): readonly { value: string; note?: string; }[]; /** * What applying a palette should report into the transcript. * * The scrollback caveat is stated only where it is TRUE. On the first switch of * a session there may be nothing above worth mentioning, but the command cannot * know that — it does not own the transcript — so it says it whenever the * palette actually changed, and stays quiet when a reader re-picks the palette * they already had. * @param palette - the palette now in force. * @param depth - what the terminal can actually show. * @param changed - whether this switch changed anything. * @param note - what storing the choice had to say, when it had anything. * @returns the report line. */ export declare function themeReport(palette: Palette, depth: ColorDepth, changed: boolean, note?: string | undefined): string; /** What the caller has to supply for `/theme` to do its work. */ export interface ThemeCommand { /** Plugin context, for the picker overlay. */ readonly ctx: Context; /** The palette currently in force. */ readonly current: () => Palette; /** What the terminal can show, resolved once when the window opened. */ readonly depth: ColorDepth; /** Install a palette for this window. */ readonly apply: (palette: Palette) => void; /** Write finished rows into scrollback. */ readonly commit: (lines: readonly string[]) => void; /** * Store the choice in the settings user layer. Injected so the command can * be tested without a settings service, and so a deployment that mounts * none still switches for the life of the window. * @param id - the theme now in force. * @returns a phrase to append to the report, or nothing to add. */ readonly remember?: (id: string) => Promise; } /** * Run `/theme`, named or asked for. * * Named and asked-for meet at one resolve, so a typed word and a chosen row * cannot drift — the same rule `/usage` and `/reasoning` follow. A name that * matches nothing reports what was on offer instead of opening a picker the * reader did not ask for. * @param spec - the window seams this command needs. * @param rawInput - exactly what followed the command name. * @returns once the switch and its report are complete. */ export declare function runThemes(spec: ThemeCommand, rawInput: string): Promise; //# sourceMappingURL=index.d.ts.map