agtrace_types/domain/
session.rs

1use serde::{Deserialize, Serialize};
2
3use super::project::ProjectHash;
4
5/// Source of the agent log (provider-agnostic identifier)
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7#[serde(transparent)]
8pub struct Source(String);
9
10impl Source {
11    pub fn new(name: impl Into<String>) -> Self {
12        Self(name.into())
13    }
14}
15
16/// Tool execution status (used in Span API)
17#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
18#[serde(rename_all = "snake_case")]
19pub enum ToolStatus {
20    Success,
21    Error,
22    InProgress,
23    Unknown,
24}
25
26/// Session summary for listing
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct SessionSummary {
29    pub session_id: String,
30    pub source: Source,
31    pub project_hash: ProjectHash,
32    pub start_ts: String,
33    pub end_ts: String,
34    pub event_count: usize,
35    pub user_message_count: usize,
36    pub tokens_input_total: u64,
37    pub tokens_output_total: u64,
38}