Foundation / tool
KatanA Chat UI
A small Rust library that keeps conversation history and an input draft in a host-neutral display model. The public version is a foundation stage; hosts connect their own UI and AI provider.
Developers integrating chat UI into KatanA-family applications
01
Implemented capabilities
02
Getting started
- Get the repository and review the README to confirm the foundation-stage scope and host responsibilities.
- Run cargo test -p katana-chat-ui to inspect draft and display-model tests, then connect ChatPanel to your own UI.
Prepare Rust and the required development tools, then check the linked README for environment requirements before installing. Examples show an entry point and do not guarantee operation in every environment.
Evidencegit clone https://github.com/HiroyukiFuruno/katana-chat-ui.git
cd katana-chat-ui
cargo test -p katana-chat-ui01 / KCU
Where it fits
Keep minimal chat state outside the UI framework
ChatPanelState stores ChatTurn history and the draft string, then ChatPanelRenderModel exposes the history count and draft. A host can render that model with its own UI framework while keeping widget implementation out of KCU itself.
Prepare the contract before an ACP connection
The public katana-acp-client exposes AiRequest, AiResponse, and AiProvider for passing intent, document context, prompt, and ChatTurn history across the provider boundary. KCU does not complete that provider connection; the host or a connector implements the contract.
02 / KCU
Input to output
Let the host own state
The host creates ChatPanelState and owns the lifecycle of history and draft. ChatPanel::new only borrows that state mutably; it does not own the application workspace or document state.
Turn input into a display model
The UI writes through ChatPanel::draft_mut(), then render_model() produces ChatPanelRenderModel with history_len and draft. The latest implementation deliberately has no old attachment, message-output, or streaming UI processing, so those are not available KCU behavior.
Connect the provider at the host boundary
An ACP host fills AiRequest with AiIntent, DocumentContext, prompt, and ChatTurn history, then calls AiProvider::execute(). The host or connector is responsible for applying the returned AiResponse to history or display; that response handling is not implemented in KCU itself.
03 / KCU
Key APIs and CLI
ChatPanelState- Stores history as Vec<ChatTurn> and draft as String, which is the complete latest chat state. It does not persist input or history and does not manage provider execution.
ChatPanel- Borrows state with new(), updates input through draft_mut(), and creates a display snapshot with render_model(). It is a thin framework-neutral facade and does not own application workspace or document state.
ChatPanelRenderModel- Contains history_len and draft for host rendering as an immutable display model. Detailed message output and output actions are not part of the latest KCU public types, so the host must provide those responsibilities if needed.
AiRequest and AiProvider- AiRequest carries intent, DocumentContext, prompt, and history; AiProvider defines available, capabilities, models, and execute. ACP transport remains scaffolding, so these types define a provider boundary rather than a completed provider integration.
04 / KCU
Concrete example
Create a render model from a draft
Create a default ChatPanelState, pass a mutable reference to ChatPanel::new(), append input through draft_mut(), and call render_model(). The host then passes history_len and draft to its own UI; this example only exercises the state/display boundary.
use katana_chat_ui::{ChatPanel, ChatPanelState};
fn main() {
let mut state = ChatPanelState::default();
let mut panel = ChatPanel::new(&mut state);
panel.draft_mut().push_str("Explain this document");
let model = panel.render_model();
println!("history={} draft={}", model.history_len, model.draft);
}05 / KCU
Integration boundaries
Implement host UI and provider separately
The README describes katana-chat-ui as framework-neutral state and render-model code, with Floem as a planned reference UI and connectors as a planned boundary. Integrators render ChatPanelRenderModel in their own UI and connect ACP or a direct provider separately, rather than expecting KCU to provide that host layer.
Keep the scaffolding boundary explicit
The latest public README status is Scaffolding. Workspace shell, document state, UI adapter, diagram rendering, and document export are outside scope, so adopt KCU only as a minimal draft/display and ACP-contract foundation and keep those responsibilities in the host.
Evidence
This overview is based on the public repositories at the time of review. Verify implementation and usage in the linked pinned commits.