import type { StatusLineModel, TwentyFourHourOverlay } from './skill-statusline-service.js'; import { computeRootSuffix as computeRootSuffixImpl } from './skill-statusline-sid-suffix.js'; export { formatShortSid } from './skill-statusline-sid-suffix.js'; export declare const computeRootSuffix: typeof computeRootSuffixImpl; import { type StatusLineCapability, type StatusPalette } from './statusline-palette.js'; export type { StatusLineCapability } from './statusline-palette.js'; /** * Pure formatting layer for the Peaks statusLine. Takes the read-only status * model and produces the single line Claude Code paints at the bottom of the * terminal. Kept separate from the reader so formatting can be tested without * touching the filesystem. * * Capability-aware rendering: three glyph palettes are kept side by side in * {@link PALETTES} so the switch from "active" / "idle" / "warning" to a * concrete string happens in one place. Adding a fourth capability (e.g. for * a future IDE) is a one-table change. */ export interface StatusLineRenderOptions { readonly capability: StatusLineCapability; } export declare function formatHumanAge(ageMs: number | null): string; /** * overlay suffix appended after the existing `` token in * the ACTIVE state. Returns `''` when the overlay is `null` (missing * file / corrupt file / wrong shape — see `read24hOverlay`). * * Output shape (ASCII palette): ` . [24h-]` * Output shape (unicode palette): ` · [24h-]` * * en-US only; i18n deferred to a future slice (PRD §Non-goals.5). * The `[24h-...]` prefix is a deliberate marker so the user can * visually distinguish a 24h-mode substate from a base-mode token * like `[full-auto]`. */ export declare function format24hSuffix(overlay: TwentyFourHourOverlay | null, palette: StatusPalette, capability: StatusLineCapability, noColor: boolean): string; export declare function resolveStatusLineCapability(input: { readonly env: NodeJS.ProcessEnv; readonly isTTY: boolean; readonly forced?: StatusLineCapability; }): StatusLineCapability; export declare function isNoColorEnv(env: NodeJS.ProcessEnv): boolean; /** * Visible-character width of an ANSI-bearing string. Skips every * `\x1b[...m` escape so the count reflects what the terminal paints, * not the byte length on the wire. */ export declare function visibleCharWidth(s: string): number; interface AnsiToken { readonly kind: 'text' | 'esc'; readonly value: string; } /** * Split an ANSI string into a flat token stream. Escape sequences are * grouped as `\x1b[...m` (single token, kind='esc'); everything else * is grouped as a single 'text' run. Used by {@link applyMarquee} to * locate visible-cell ranges inside an SGR-bearing string. */ export declare function tokenizeAnsi(s: string): readonly AnsiToken[]; /** * Apply the marquee highlight band to an ANSI-bearing string. Pure. * - `bandStart` / `bandEnd` are visible-cell indices (0-based). * - Cells in [bandStart, bandEnd] receive a `\x1b[1;38;2;224;224;224m` * prefix; cells after the band receive the closing `\x1b[0m` reset * so the rest of the line keeps its original SGR. * - Empty strings and zero-width bands return the input unchanged. */ export declare function applyMarqueeHighlight(s: string, bandStart: number, bandEnd: number): string; /** * Compute the marquee band for a string at time `nowMs` and re-emit * the string with the band applied. ASCII tier is a pass-through (no * SGR to inject) — the scanner has no visible effect on plain text. */ export declare function applyMarquee(s: string, nowMs: number, capability: StatusLineCapability): string; /** * Render the status line. Pure — no I/O, no side effects. The output is * a single short line suitable for the bottom-of-terminal status bar. * * The `options.capability` field selects the glyph palette. When omitted, * the function falls back to `unicode` (no ANSI escape codes), preserving * the legacy behaviour for the CLI's `peaks statusline` invocation. * * Compact-state precedence: when `model.compact.kind !== 'none'` the * compact bar replaces the active/idle/stale content. The C1 baseline * line is preserved when the compact state is `none`. * * The full line is wrapped by {@link applyMarquee} so the brand-purple * text + non-focal bar cells share a single colour surface while the * scanner band paints its `#E0E0E0` highlight over a moving slice. * * Idle suppression: the marquee is OFF when `model.state === 'idle'` * (and no compact state is active). Idle keeps the slow-blink `○` * as the only motion — the user is asking whether the harness is * running a skill; the scan band would compete for attention and * obscure that question. Active / stale / invalid-presence / compact * states all keep the marquee. */ export declare function renderStatusLine(model: StatusLineModel, options?: StatusLineRenderOptions, env?: NodeJS.ProcessEnv): string;