1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! `trusty-code-tui` — the engine-agnostic terminal-UI seam shared by
//! trusty-code's `tcode tui` and trusty-agents' tagent REPL.
//!
//! Why: today, tagent owns a mature ratatui-based REPL
//! (`crates/trusty-agents/src/repl/tui/`) and trusty-code has no interactive
//! TUI at all. Forking tagent's REPL for trusty-code would duplicate ~2,500
//! lines of event-loop, widget, and line-editing code and let the two drift.
//! DOC-50 §2.2 resolves this by extracting the engine-agnostic parts into
//! this crate; each product supplies a thin [`TuiEngine`] adapter instead.
//!
//! What: **Slice 1** (#3412, epic #3411) shipped the seam itself — the
//! [`TuiEngine`] trait and the [`ReplEvent`] enum both products' adapters
//! and the shared event loop speak. **Slice 1.5** (#3413) added the
//! [`model`] module: the engine-supplied data types ([`StatuslineSegment`],
//! [`PickerItem`]/[`PickerRequest`], [`CommandDescriptor`]) that keep the
//! statusline, pickers, and slash-command help free of any product-specific
//! constant (no hardcoded model lists, no hardcoded `/model`/`/provider`
//! strings, no cost formula). **Slice 2** (#3414) adds the terminal layer
//! this doc comment used to say was missing: the panic-safe
//! [`TerminalGuard`] ([`terminal`]), the generic-over-`TuiEngine` render/event
//! loop ([`run`](mod@crate::run)), and the `crossterm` → [`KeyInput`] translation boundary
//! ([`keys`]). `ratatui`/`crossterm` are now real dependencies of this crate
//! (0.30/0.29 — see `Cargo.toml`'s comment on why that diverges from the
//! rest of the workspace's 0.29/0.28 pin during the migration window) but
//! stay confined to `terminal`/`run`/`keys`; [`event`] and [`model`]
//! themselves still have zero terminal-library dependency, by design.
//! **Slice 4** (#3416, epic #3411, DOC-50 §5 Slice 4) adds the render/reducer
//! model ([`app`]), the widgets that draw it ([`widgets`]), the pure
//! markdown-rendering helpers those widgets call into ([`render`]), and the
//! top-level frame composition ([`layout`]) — generalized, behavior-
//! preserving ports of tagent's `repl/tui/{chat,banner,markdown,layout}.rs`.
//! **Slice 7** (#3420, epic #3411, DOC-50 §5 Slice 7 / §6 Q4) adds the
//! [`commands`] module: the slash-command parser/dispatcher implementing
//! "mixed routing" — `/help`/`/clear`/`/quit`/`/exit` are client-side
//! built-ins that never reach `TuiEngine::handle_input`; every other
//! command (domain commands like `/model`/`/workstream`, plain chat, and
//! any command this crate doesn't recognize) forwards verbatim, per the
//! thin-client axiom. Also adds the inline-picker half of that routing
//! (DOC-50 §3.2/§6 Q6): a bare `/name` matching `TuiEngine::picker(name)`
//! opens [`ReplApp::active_picker`] instead of forwarding.
//! See DOC-50 §5 for the full slice breakdown (Slice 10 is the tagent
//! cutover this crate is building toward).
//!
//! Dependency direction (DOC-50 §2.2, binding): `trusty-code` and
//! `trusty-agents` depend on `trusty-code-tui`; `trusty-code-tui` depends on neither.
//! This crate's public API therefore never references a product-specific
//! type.
//!
//! # Spec References
//! - [`SPEC-TTUI-02~draft`](../../../docs/specs/DOC-50-tcode-tui-claude-code-clone.md#SPEC-TTUI-02~draft) — architecture, the engine-adapter seam.
//! - [`SPEC-TTUI-03~draft`](../../../docs/specs/DOC-50-tcode-tui-claude-code-clone.md#SPEC-TTUI-03~draft) — extraction and migration plan.
//! - [`SPEC-TTUI-05~draft`](../../../docs/specs/DOC-50-tcode-tui-claude-code-clone.md#SPEC-TTUI-05~draft) — Slice 1, 2, and 4 deliverables and acceptance criteria.
// docs.rs builds a release's documentation once, from the uploaded tarball,
// so a broken intra-doc link is baked into that version forever and only a new
// release can correct it. Deny keeps this crate at zero rather than letting the
// ratchet in `scripts/check_rustdoc_links.sh` absorb a new one.
pub use ;
pub use ;
pub use TuiEngine;
pub use ;
pub use translate_key_event;
pub use draw;
pub use ;
pub use ;
pub use TerminalGuard;