use crate::providers::Usage;

/// Provider-reported usage committed with one durable assistant Turn.
#[derive(Debug, Clone)]
pub struct TurnUsageRecord {
    pub session_id: String,
    pub turn_id: String,
    pub provider: String,
    pub model: String,
    pub usage: Usage,
    /// Prompt usage from the final provider request in the Turn. Unlike
    /// `usage.prompt_tokens`, this is not accumulated across tool iterations.
    pub last_prompt_tokens: u32,
    pub created_at: i64,
}

#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct SessionUsageTotals {
    pub prompt_tokens: u64,
    pub completion_tokens: u64,
    pub total_tokens: u64,
    pub cached_input_tokens: Option<u64>,
    pub request_count: u64,
    pub turn_count: u64,
    pub tracked_since: Option<i64>,
    pub last_prompt_tokens: Option<u64>,
    pub last_observed_at: Option<i64>,
}
