@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
61 lines • 3.08 kB
TypeScript
import { type FooterRightForm, type FooterSegment } from "./footer-layout.ts";
/** One coloured run of the right side, in render order. */
export type RightSideRun = {
readonly text: string;
readonly color: "muted" | "warning" | "accent" | "dim" | "borderMuted";
};
/**
* Color the right side of the footer: (provider) muted, model accent, the
* `effort <level>` label muted and its cycle-key hint dim.
*
* The runs come from the values that produced the text, never from re-parsing
* the rendered string: an account display name may legally contain `)` or `:`,
* and a regex over the rendered segment would then colour the provider prefix
* as the model, or cut the model id into a "thinking level".
*
* `plain` is the rendered segment, which the layout pass may have truncated at
* the tail (and whose truncation can append reset sequences); each run is
* clipped to the visible text that survived, so a run boundary can never cut
* an escape sequence in half.
*/
export declare function colorRightSide(runs: readonly RightSideRun[], plain: string): string;
export interface RightLabelInput {
readonly modelName: string;
readonly fastIndicator: string;
readonly routed: {
readonly modelId: string;
readonly thinkingLevel: string | undefined;
} | undefined;
/** A switch held until the next message compacts for it (senpi#1873): shown beside the running model (senpi#6092). */
readonly pending: {
readonly modelId: string;
} | undefined;
readonly reasoning: boolean;
readonly thinkingLevel: string;
readonly providerPrefix: string;
readonly separator: string;
}
export interface RightLabel {
readonly forms: [FooterRightForm, ...FooterRightForm[]];
readonly floor: FooterSegment;
readonly floorRuns: readonly RightSideRun[];
}
/**
* The right-label ladder, richest first. The readable `model • effort <level>`
* forms (with and without the cycle-key hint) are used only when the whole footer
* fits as is, so they never cost a live stat or a path character. Below that the
* label is the compact `model:<level>` the footer always had: with the provider
* prefix while middle stats may still elide, then alone with pwd elision, down to
* the same floor as before. The key hint therefore drops first, then the readable
* label, then the provider; the model id and its level stay as long as they ever did.
*
* A held switch rides in every form as `→ <target> (after compact)`, right after
* the running model (and its level in the compact forms): the pick the user just
* made must be visible at once, so it is never the first thing the ladder drops.
* Below the compact form with the full target id sits one more rung, the floor,
* where the target id is head-elided to `HELD_TARGET_FLOOR_COLUMNS` and the
* `(after compact)` marker is kept whole, so a narrow terminal never shows a
* mid-id fragment and keeps its context meter.
*/
export declare function buildRightLabel(input: RightLabelInput): RightLabel;
//# sourceMappingURL=footer-right-label.d.ts.map