Expand description
Chat orchestration state machine.
Owns conversation state, token parsing, tool call detection, and the agentic loop. Used by both the TUI and web GUI — they are thin renderers over this core.
This crate has no I/O, no platform deps, no async runtime. It is pure state machine logic that can be compiled to any target (native, WASI, wasm32).
Modules§
- capnp
- Minimal Cap’n Proto builder for ChatCoreOut messages.
Structs§
- Chat
History Entry - A single message in the conversation history.
- Chat
State - Core chat orchestration state.
- Tool
Call Record - A recorded tool call and its result (or in-flight state).
Enums§
- Chat
Command - Commands sent to the chat state machine.
- Chat
Event - Events emitted by the chat state machine.
These are structured — clients never see raw
<think>or<tool_call>tags. - Chat
Role - Role of a chat history entry.
- Tool
Call Format - Model-specific tool call syntax.
Functions§
- parse_
tool_ call_ buf - Parse a tool call buffer. Tries JSON first (Qwen3/Hermes), then Qwen3.5 XML parameter format.
- parse_
xml_ param_ tool_ call - Parse a Qwen3.5 XML parameter-format tool call block.