Expand description
Engine-supplied UI data: StatuslineSegment, PickerItem/PickerRequest,
and CommandDescriptor.
Why: DOC-50 §3.2 (Slice 1.5) requires the statusline, pickers, and
slash-command help to be driven entirely by data the engine supplies, not
by constants baked into the shared crate. Slice 1 shipped provisional
stubs for these three types directly in crate::event, flagged as
zero-consumer placeholders; this module is their real, spec-shaped home.
Splitting them out of event.rs also keeps that module’s focus narrow
(the ReplEvent wire vocabulary) versus this module’s focus (the
semantic data an engine hands the TUI to render).
What: three families of type, one per generalized surface:
StatuslineSegment— an enum, per DOC-50 §3.2’s explicit correction of Slice 1’s flat{label, value}struct.PickerItem/PickerRequest— a named, engine-supplied picker (replacing tagent’s hardcodedPickerKind::{Model,Provider},crates/trusty-agents/src/repl/tui/types.rs:28-35).CommandDescriptor/CommandRouting— a slash-command registry entry that records whether the shared crate or the engine handles it (replacing tagent’s hardcodedSLASH_COMMANDSarray,crates/trusty-agents/src/repl/tui/helpers.rs:156-181).
None of these types encode product-specific formulas or lists (e.g.
tagent’s OpenRouter haiku cost formula, crates/trusty-agents/src/repl/tui/status.rs:145-155,
or its /model//provider literals) — that logic stays in each engine
adapter (AgentEngine, CodeEngine); this crate only defines the shapes
the engine populates.
§Spec References
SPEC-TTUI-03~draft— §3.2, the generalization layer this module implements.SPEC-TTUI-05~draft— Slice 1.5 deliverable and acceptance criteria.
Structs§
- Command
Descriptor - One entry in an engine-supplied slash-command registry.
- Picker
Item - One selectable row in an engine-supplied picker (model, provider, workstream, …).
- Picker
Request - A complete engine-supplied picker: what to show, and what selecting an item does.
Enums§
- Command
Routing - Which side of the seam dispatches a
CommandDescriptor(DOC-50 §6 Q4, “mixed routing”). - Statusline
Emphasis - A generic, wire-safe (JSON, via
serde) style hint an engine can attach to a free-form statusline segment (StatuslineSegment::Custom/StatuslineSegment::Chrome). - Statusline
Segment - One labeled segment of the status line, supplied by the engine.