Skip to main content

Module input_composer

Module input_composer 

Source
Expand description

The input composer row — generalized port of tagent’s chat.rs::draw_input.

Why: DOC-50 §5 Slice 4 migrates the borderless, Claude-Code-style prompt row. Generalization dropped tagent’s inline token counters (↑{in} ↓{out}) — the same product-specific usage-tracking DOC-50 Q9 keeps out of the shared crate (no cost/usage formula here). Everything else — prompt label, the empty-buffer placeholder swapping busy/idle text, AND the right-aligned [thinking...] decoration — is a direct, width-aware port: tagent renders that decoration whenever app.thinking is true, REGARDLESS of whether the input buffer is empty (a user typing ahead while the agent is still responding still sees it). An earlier revision of this module only surfaced busy state through the empty- buffer placeholder, which silently dropped that case — see crate::app’s module doc comment for the full disclosure list.

What: draw_input renders "{label}> {input_or_placeholder}" with the [thinking...] label right-aligned when app.busy and space allows, and positions the terminal cursor at the true edit position within the typed text.

§Spec References

Functions§

draw_input
Render the input composer row into area and position the terminal cursor at the true edit position.