ai-agent 0.13.4

Idiomatic agent sdk inspired by the claude code source leak
Documentation
#![allow(dead_code)]

use std::collections::HashMap;

pub fn format_timestamp(timestamp: i64) -> String {
    format!("{}", timestamp)
}

pub fn format_duration(ms: u64) -> String {
    format!("{}ms", ms)
}

pub fn format_relative_time(timestamp: i64) -> String {
    let now = std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)
        .unwrap()
        .as_secs() as i64;
    let diff = now - timestamp;
    if diff < 60 {
        format!("{}s ago", diff)
    } else if diff < 3600 {
        format!("{}m ago", diff / 60)
    } else if diff < 86400 {
        format!("{}h ago", diff / 3600)
    } else {
        format!("{}d ago", diff / 86400)
    }
}