docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Creates formatted status messages with color-coded background labels for terminal output.
Each formatted string begins with the uppercase status label padded to the provided labelWidth (or left as-is when no width is given). The label is wrapped in the appropriate background color for the level, followed by a space and the original message left unstyled.
{ level: "error", message: "Disk full" } into a string whose leading label uses the standard red background while leaving "Disk full" unstyled. @test{ level: "success", message: "Completed" } into a string whose leading label uses the standard green background while leaving "Completed" unstyled. @test{ level: "notice", message: "Deploying" } into a string whose leading label uses a bright blue background, not the standard intensity. @test{ level: "muted", message: "Skipped optional step" } into a string whose leading label uses the bright black/gray background variant (the bright alias for black) while leaving the message plain. @testtype StatusLevel = 'error' | 'success' | 'notice' | 'muted';
interface StatusItem {
level: StatusLevel;
message: string;
}
interface FormatOptions {
labelWidth?: number; // optional fixed label width; pad labels with spaces when provided
}
export function formatStatus(item: StatusItem, options?: FormatOptions): string;Provides terminal styling with standard and bright background color helpers.