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

Style Profile Validator

Build a utility that validates terminal style profiles using the styling library's published metadata.

Capabilities

Validate profile tokens

  • Accepts a profile object with optional modifiers, foreground, and background string arrays; when all provided tokens exist in the dependency's metadata lists for their category (case-insensitive), returns no unsupported entries. @test
  • Flags unsupported tokens per category while leaving valid ones untouched; outputs category lists sorted case-insensitively. @test

Supported styles listing

  • Exposes a snapshot of supported modifier, foreground color, and background color names sourced from the dependency metadata, preserving the dependency's ordering. @test

Normalization

  • Normalizes accepted tokens to the dependency's canonical casing when returning valid tokens and omits categories that were not provided in the input. @test

Implementation

@generates

API

export interface StyleProfile {
  modifiers?: string[];
  foreground?: string[];
  background?: string[];
}

export interface ValidationResult {
  valid: Partial<Record<"modifiers" | "foreground" | "background", string[]>>;
  unsupported: Partial<Record<"modifiers" | "foreground" | "background", string[]>>;
}

export function validateProfile(profile: StyleProfile): ValidationResult;

export function listSupportedStyles(): {
  modifiers: string[];
  foreground: string[];
  background: string[];
};

Dependencies { .dependencies }

chalk { .dependency }

Provides terminal styling metadata for validation.