codetether-agent 4.5.7

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum MessageType {
    User,
    Assistant,
    System,
    Error,
    ToolCall {
        name: String,
        arguments: String,
    },
    ToolResult {
        name: String,
        output: String,
        success: bool,
        #[serde(default)]
        duration_ms: Option<u64>,
    },
    Thinking(String),
    Image {
        url: String,
    },
    File {
        path: String,
        #[serde(default)]
        size: Option<u64>,
    },
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChatMessage {
    pub message_type: MessageType,
    pub content: String,
    pub timestamp: std::time::SystemTime,
}

impl ChatMessage {
    pub fn new(message_type: MessageType, content: impl Into<String>) -> Self {
        Self {
            message_type,
            content: content.into(),
            timestamp: std::time::SystemTime::now(),
        }
    }
}