magi-code 0.77.1

Repository-aware CLI coding agent for terminal work
Documentation
# Shared rendering guide

## Scope

Converts text into semantic display lines; terminal layout and state belong to callers.

## Where to look

| Task | Path |
| --- | --- |
| Input kinds, display spans/roles, dispatch | `mod.rs` |
| Markdown structure | `markup.rs` |
| Syntax-aware code roles | `highlight.rs` |
| Diff line classification | `diff.rs` |

## Local rules

- Return `DisplayLine`/`DisplaySpan` with `DisplayRole`, not terminal colors or backend widgets. Mission Control maps roles to its presentation.
- Markdown uses pulldown-cmark events. Code blocks delegate to shared rendering/highlighting rather than embedding another highlighter.
- Syntax assets are lazily shared through `OnceLock`. Unknown languages and oversized code use fallback roles.
- Preserve the highlighter limits: 400 lines and 64 KiB. These limit highlighting work, not total rendered output.
- Diff rendering classifies text only; it neither validates nor applies a patch. File headers must be classified before ordinary added/removed lines.
- These helpers do not enforce general output byte limits, redaction, or width wrapping. Callers must sanitize and bound display input and handle terminal layout.