mind: split event loop — Mind and UI run independently

Mind::run() owns the cognitive event loop: user input, turn results,
DMN ticks, hotkey actions. The UI event loop (user/event_loop.rs) owns
the terminal: key events, render ticks, channel status display.

They communicate through channels: UI sends MindMessage (user input,
hotkey actions) to Mind. Mind sends UiMessage (status, info) to UI.
UI reads shared state (active tools, context) directly for rendering.

Removes direct coupling between Mind and App:
- cycle_reasoning no longer takes &mut App
- AdjustSampling updates agent only, UI reads from shared state
- /quit handled by UI directly, not routed through Mind

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2026-04-05 02:11:32 -04:00
parent 1f06b49503
commit 804d55a702
3 changed files with 227 additions and 170 deletions

View file

@ -4,6 +4,7 @@
// machine, DMN, identity) lives in mind/.
pub mod ui_channel;
pub mod event_loop;
pub mod chat;
pub mod context;