use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct WorkspaceStatusRequest {
pub workspace_root: PathBuf,
pub store_path: PathBuf,
pub include_breakdown: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkspaceStatus {
pub scanned: bool,
pub store_path: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tree: Option<TreeStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
pub context_coverage: Option<Vec<ContextCoverageEntry>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub top_paths_by_node_count: Option<Vec<PathCount>>,
}
pub type WorkspaceStatusResult = WorkspaceStatus;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TreeStatus {
pub root_hash: String,
pub total_nodes: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub breakdown: Option<Vec<PathCount>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PathCount {
pub path: String,
pub nodes: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ContextCoverageEntry {
pub agent_id: String,
pub nodes_with_frame: u64,
pub nodes_without_frame: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_pct: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentStatusEntry {
pub agent_id: String,
pub role: String,
pub valid: bool,
pub prompt_path_exists: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentStatusOutput {
pub agents: Vec<AgentStatusEntry>,
pub total: usize,
pub valid_count: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProviderStatusEntry {
pub provider_name: String,
pub provider_type: String,
pub model: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub connectivity: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProviderStatusOutput {
pub providers: Vec<ProviderStatusEntry>,
pub total: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UnifiedStatusOutput {
#[serde(skip_serializing_if = "Option::is_none")]
pub workspace: Option<WorkspaceStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
pub agents: Option<AgentStatusOutput>,
#[serde(skip_serializing_if = "Option::is_none")]
pub providers: Option<ProviderStatusOutput>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ValidateResult {
pub valid: bool,
pub root_hash: String,
pub node_count: usize,
pub frame_count: usize,
pub errors: Vec<String>,
pub warnings: Vec<String>,
}
#[derive(Debug, Clone, Serialize)]
pub enum IgnoreResult {
List { entries: Vec<String> },
Added { path: String },
}
#[derive(Debug, Clone, Serialize)]
pub struct ListDeletedRow {
pub path: String,
pub node_id_short: String,
pub tombstoned_at: u64,
pub age: String,
}
#[derive(Debug, Clone, Serialize)]
pub struct ListDeletedResult {
pub rows: Vec<ListDeletedRow>,
}