Expand description
ChatApp — LLM chat terminal application.
On native, implements [waxterm::app::TerminalApp] so it can be spawned via
spawn_app_process inside the TuiService frame loop. The inference
background thread is injected as a StreamSpawner closure.
On WASM, works as a push-based state machine: the host calls on_token(),
on_stream_complete(), etc. directly, and submit_message_payload() returns
the serialized JSON request for the host to forward.
Structs§
- ChatApp
- Chat
GenConfig - Per-session inference configuration, adjustable via the Settings modal.
- Chat
History Entry - A single message in the conversation history.
- Tool
Call Record - A recorded tool call and its result (or in-flight state).
Enums§
- Chat
Event - Events sent from the inference background thread to
ChatApp::tick. - Chat
Mode - Chat
Role - Role of a chat history entry.
- Tool
Call Format - Tool-call output format used by a model family.
Type Aliases§
- Cancel
Handle - One-shot cancellation handle returned by
StreamSpawner. Calling it signals the background thread to abort the current stream. - Load
Hook - Called once at construction to restore prior history (returns
Noneif no history exists yet). - Save
Hook - Called after
StreamCompleteto persist the current history. - Stream
Spawner - Injected by
service.rs— captures signing_key + model_ref. - Tool
Caller - Tool executor injected at construction time.