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-8/

Status Palette Formatter

Build a typed status formatting helper for terminal output. It must rely on the styling library's TypeScript definitions to assemble colorized labels, including an option to use its deprecated neutral-tone alias when requested.

Capabilities

Formats status labels

  • It renders info, success, warning, and error statuses as [LABEL] message with labels uppercased, applies the corresponding style from the library (neutral gray for info, green for success, yellow for warning, red for error), and resets formatting after the message. @test

Deprecated neutral tone

  • When neutralTone is set to deprecated, the info label uses the dependency's deprecated neutral shade alias (the alternative spelling) instead of the canonical name while other labels keep their styles. @test

Stream-aware palette

  • A palette created with stream: "stderr" bases its styling decisions on color support for that stream; disabling color for stderr leaves that palette unstyled while a default palette remains colored. @test

Lists styles

  • listStyles() returns all supported status kinds in order ["info", "success", "warning", "error"], reflecting the neutral tone variant currently in use. @test

Implementation

@generates

API

export type StatusKind = "info" | "success" | "warning" | "error";

export interface PaletteOptions {
  stream?: "stdout" | "stderr";
  neutralTone?: "modern" | "deprecated";
}

export interface StatusPalette {
  format(kind: StatusKind, message: string): string;
  listStyles(): StatusKind[];
}

export function createStatusPalette(options?: PaletteOptions): StatusPalette;

Dependencies { .dependencies }

chalk { .dependency }

Provides typed terminal styling helpers and deprecated neutral-tone alias support.