CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-wrap-ansi

Wordwrap a string with ANSI escape codes

Overall
score

100%

Overview
Eval results
Files

rubric.jsonevals/scenario-1/

{
  "context": "This evaluation assesses how well the engineer uses the wrap-ansi package to handle multiple types of ANSI escape sequences (SGR codes and OSC 8 hyperlinks) during text wrapping. The focus is on correct usage of wrap-ansi's core functionality to preserve different escape sequence types.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses wrap-ansi",
      "description": "The solution imports and uses the wrapAnsi function from the wrap-ansi package (default export or named import)",
      "max_score": 20
    },
    {
      "name": "Correct function signature",
      "description": "Calls wrapAnsi with the correct parameters: wrapAnsi(string, columns, options?) where string is the text to wrap and columns is the width",
      "max_score": 15
    },
    {
      "name": "Plain text wrapping",
      "description": "Successfully wraps plain text without escape sequences by passing text and column width to wrapAnsi",
      "max_score": 15
    },
    {
      "name": "SGR code preservation",
      "description": "Correctly handles text with SGR (Select Graphic Rendition) codes by using wrapAnsi, which automatically preserves color and style codes during wrapping",
      "max_score": 20
    },
    {
      "name": "OSC 8 hyperlink preservation",
      "description": "Correctly handles text with OSC 8 hyperlink sequences by using wrapAnsi, which automatically maintains clickable links across wrapped lines",
      "max_score": 20
    },
    {
      "name": "Mixed escape sequences",
      "description": "Successfully handles text containing both SGR codes and OSC 8 hyperlinks simultaneously by relying on wrapAnsi's built-in support for multiple escape sequence types",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-wrap-ansi

tile.json