17. Prompt Input and Message UI
Why the UI Layer Matters
The source tree has a surprisingly large number of files under components/PromptInput/ and components/messages/.
That is a clue: the product experience is built through many specialized interaction components, not one generic text console.
Prompt Input Responsibilities
- Input modes and placeholders
- Footer hints, suggestions, queued command display
- History search and stash notices
- Sandbox and fast-mode hints
- Voice and swarm indicators
Message Rendering Responsibilities
- Separate components for assistant text, thinking, tool use, errors, plans, compact boundaries, and attachments
- Specialized rendering for user tool results and tool failure states
- Grouped displays for collapsed search/read operations
- Different visual treatments for system, user, assistant, and background-agent events
Main Lesson
A strong terminal product invests heavily in interaction design. If you want your own CLI agent to feel usable rather than raw,
this is the layer to study after you understand the execution core.
Source Navigation
Recommended Source Files
source/components/PromptInputsource/components/messagessource/ink/components/App.tsxsource/ink/hooks/use-input.tssource/state/AppStateStore.ts
Next Files to Read
source/components/TrustDialog/TrustDialog.tsxsource/history.tssource/ink/render-to-screen.ts