use serde_json::Value as JsonValue;
#[derive(Debug, Clone)]
pub struct ConversationMessage {
pub entry_id: String,
pub kind: MessageKind,
}
impl ConversationMessage {
#[must_use]
pub fn new(entry_id: impl Into<String>, kind: MessageKind) -> Self {
Self {
entry_id: entry_id.into(),
kind,
}
}
}
#[derive(Debug, Clone)]
pub enum MessageKind {
TextContent(TextContent),
AssistantResponse(AssistantResponse),
ToolResultData(ToolResultData),
BashOutput(BashOutput),
}
#[derive(Debug, Clone)]
pub struct TextContent {
pub role: String,
pub text: String,
}
#[derive(Debug, Clone)]
pub struct AssistantResponse {
pub thinking: Vec<String>,
pub tool_calls: Vec<ToolCall>,
pub text: String,
}
#[derive(Debug, Clone)]
pub struct ToolResultData {
pub tool_name: String,
pub content: String,
pub is_error: bool,
}
#[derive(Debug, Clone)]
pub struct BashOutput {
pub command: String,
pub output: String,
}
#[derive(Debug, Clone)]
pub struct ToolCall {
pub name: String,
pub arguments: JsonValue,
}
#[derive(Debug, Clone)]
pub struct Entry {
pub id: String,
pub parent_id: String,
}
#[derive(Debug, Clone)]
pub struct Context {
pub entries: Vec<Entry>,
pub messages: Vec<ConversationMessage>,
}
#[derive(Debug, Clone)]
pub struct ContextListing {
pub id: String,
pub detail: String,
}
#[derive(Debug, Clone)]
pub struct TaggedListing {
pub provider: &'static str,
pub listing: ContextListing,
}