magi-code 0.97.6

Repository-aware CLI coding agent for terminal work
Documentation
# Transcript cards guide

Typed display cards, bounded visual windows and source-text copy mapping.

## Where to look

| Change | Owner |
| --- | --- |
| Facade/display limits | `../transcript_cards.rs` |
| Types/transcript/activity conversion | `projection.rs` |
| Cached spans/child grouping | `projection/span_cache.rs`, `projection/subagent_aggregation.rs` |
| Shared tool meaning / terminal conversion | `../../output/tool_card.rs`, `projection/tool_adapters.rs` |
| Wrapped lines/history windows/bodies | `visual_lines.rs`, `visual_lines/{scrollback,card,body}.rs` |
| Text/width/streaming cursors | `visual_lines/{user_prompt,assistant,subagent,width,streaming}.rs` |
| Display-to-source copy positions/ranges | `copy_mapping.rs`, `visual_lines/{types,copy_ranges}.rs` |
| Selection-aware orchestration | `../transcript_projection.rs` |

## Local contracts

- Card types belong in `projection.rs`; facade reexports shared surface and children stay private. Preserve source/activity IDs for navigation/cache identity, not session records.
- Wrapping respects grapheme boundaries and terminal columns; copy mapping agrees even in narrow panes. Window visible history and reuse projections rather than rebuilding all cards/frame.
- Multiline streaming uses bounded sparse cursors; unbroken text keeps full formatting. Sanitize complete source and compare completed prefixes exactly before reusing checkpoints. Measure non-ASCII generated rows with Ratatui; grapheme width alone undercounts. Copy/navigation share measured heights.
- Tool meaning comes from `output::tool_card`; TUI supplies status, command and child facts, then maps semantic blocks to rendering roles. Keep terminal highlighting, wrapping, card indices and selection here. Do not restore tool-specific meaning rules in terminal adapters.
- Main images reserve fixed non-copyable rows after text. Clipping preserves source row indices and never resizes remaining fragment when top scrolls away; activity/child viewers stay text-only.
- Code Mode final counts come from host-owned evidence, live progress from child activities. Script success differs from inner failures. Model-response token estimate comes from display metadata, not compact-card estimation/nested result sums.
- Keep selection orchestration outside primitives and runtime/provider/storage decisions outside cards.