mermaid-cli 0.5.1

Open-source AI pair programmer with agentic capabilities. Local-first with Ollama, native tool calling, and beautiful TUI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Typed events for the model-to-UI streaming channel.
//!
//! Replaces the ad-hoc string protocol ([DONE]:tokens=N, [TOOL_CALLS:...], etc.)
//! with a typed enum that eliminates string parsing and collision risks.

use crate::models::{ToolCall, UserFacingError};

/// Events sent from the model task to the UI event loop
pub enum StreamEvent {
    /// A chunk of streamed text content from the model
    Chunk(String),
    /// Tool calls extracted from the completed model response
    ToolCalls(Vec<ToolCall>),
    /// Model finished generating (total = prompt + completion tokens)
    Done { total_tokens: usize },
    /// Model returned an error
    Error(UserFacingError),
}