Behind jackin❯ — crates

jackin-term

Owned terminal model for the jackin-capsule re-emitting PTY multiplexer — the grid, parser-perform sink, damage tracking, passthrough events, and snapshot/observation APIs behind the Capsule Terminal Model.

The full design record — why vt100 was retired, the candidate survey, the borrow/re-implement ledger, the current Ratatui/emit contract, scrollback-retention semantics, and the correctness guarantees — lives in that doc. This README is the current-state map of the crate.

What this crate owns

  • The VT/ANSI parser-perform sink over vte: bytes → grid mutation + typed passthrough events.
  • The DamageGrid cell model: cursor, modes, styles, alternate screen, scrollback, wide-cell/grapheme-cluster handling, and dirty-row damage recorded at mutation time.
  • Snapshot/observation APIs (GridView, GridSnapshot) the capsule renders from, plus width and passthrough helpers.

Architecture tier and allowed dependencies

L2 infrastructure crate. Allowed workspace dependencies: jackin-core, jackin-diagnostics. No presentation, no ratatui, no host effects — only the model + diff/emit surface the capsule consumes.

Structure

ModuleOwnsTests
lib.rscrate root, re-exports
grid.rs · grid/DamageGrid cell model, scrollback, damagetests.rs
damage.rs · damage/dirty-row trackingtests.rs
cell.rspacked cell (CompactString grapheme storage)
passthrough.rstyped PassthroughEvent stream
snapshot.rs · snapshot/snapshot/observation APIstests.rs
width.rs · width/width helperstests.rs

Out-of-tree: tests/conformance.rs + tests/fixtures/ (conformance replay harness + corpus), fuzz/, benches/, examples/.

Public API

DamageGrid, the parser-perform entry point, GridView / GridSnapshot observation APIs, PassthroughEvent, and the width/snapshot helpers — consumed by jackin-capsule. The crate is pure-Rust: no unsafe, no FFI, no host-side effects (all mutation is in-memory).

How to verify

cargo nextest run -p jackin-term
cargo clippy -p jackin-term --all-targets -- -D warnings
cargo bench --bench resize_storm -p jackin-term -- --quick
cargo bench --bench scroll_throughput -p jackin-term -- --quick
cargo bench --bench present_frame -p jackin-term -- --quick

Design rationale and prior art: Capsule Terminal Model.

On this page