or run

npx @tessl/cli init
Log in

Version

Files

docs

advanced-colors.mdbackground-colors.mdbasic-colors.mdcolor-support.mdconfiguration.mdindex.mdtext-styling.md
tile.json

task.mdevals/scenario-9/

Styled Status Formatter

Creates human-readable status lines that stack nested emphasis styles while rendering multiple message segments.

Capabilities

Formats label and message parts

  • Given one status entry with label "build" and message parts ["completed", "in", "12s"] and no highlight, returns a single line where the uppercase label is clearly emphasized, followed by the message parts joined with spaces using the dependency's multi-argument rendering. @test

Applies nested emphasis

  • When highlightIndex points to a message part, that part is wrapped in a contrasting nested style without breaking the surrounding base style, even across newline boundaries. Example: label "deploy", parts ["pushing", "to", "prod"], highlightIndex = 2 renders a distinct accent on "prod" while keeping the rest uniformly styled. @test

Supports optional header

  • When a header string is provided, render it as the first line with a decorative prefix that layers an outer accent with an inner emphasis, followed by the status lines beneath it. @test

Handles multiple entries

  • Given multiple status entries, returns a multi-line string preserving order. When addSpacer is true, inserts a blank spacer line after the header (if any) before the first status line; styles reopen correctly for each subsequent line. @test

Implementation

@generates

API

export interface StatusLine {
  label: string;
  parts: string[];
  highlightIndex?: number;
}

export interface FormatOptions {
  header?: string;
  addSpacer?: boolean;
}

export function formatStatus(lines: StatusLine[], options?: FormatOptions): string;

All output lines should be joined with \n and must not end with a trailing newline.

Dependencies { .dependencies }

chalk { .dependency }

Provides chained styling for colored terminal text with nested segments.