use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum EntryKind {
    File,
    Dir,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DirEntry {
    pub name: String,
    pub kind: EntryKind,
    pub object_id: String,
    // New metadata fields
    pub size: Option<u64>,
    pub line_count: Option<usize>,
    pub word_count: Option<usize>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum FileChange {
    Added(String),
    Modified(String),
    Deleted(String),
}

#[derive(Debug, Serialize, Deserialize)]
pub struct BlobRef {
    #[serde(rename = "$vgcs_ref")]
    pub vgcs_ref: String, // "v1"
    pub sha256: String,
    pub size: u64,
    pub mime_type: String,
    pub original_name: String,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum DocNodeKind {
    Leaf,       // Pure content node (file)
    Composite,  // Composite node (dir with index.md)
    Section,    // Virtual node (Markdown Header inside a file)
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct DocNode {
    pub name: String,
    pub path: String, // Logical path e.g., "Analysis/Revenue"
    pub kind: DocNodeKind,
    pub children: Vec<DocNode>, // Only for Composite or Section-bearing Leaf
}
