use serde::Serialize;
pub use gradatum_dto::{
VaultClassifyRequest, VaultContextRequest, VaultDowngradeRequest, VaultGraphRequest,
VaultLinksRequest, VaultListRequest, VaultReadRequest, VaultSearchRequest, VaultTraceRequest,
VaultWriteRequest,
};
#[derive(Debug, Serialize)]
pub struct SearchHit {
pub path: String,
pub score: f32,
pub title: Option<String>,
pub snippet: Option<String>,
pub trust: f32,
}
#[derive(Debug, Serialize)]
pub struct VaultSearchResponse {
pub items: Vec<SearchHit>,
}
#[derive(Debug, Serialize)]
pub struct VaultReadResponse {
pub path: String,
pub content: String,
pub metadata: Option<serde_json::Value>,
pub size_bytes: u64,
pub sha256: String,
}
#[derive(Debug, Serialize)]
pub struct VaultEntry {
pub path: String,
pub size_bytes: u64,
pub modified_at: String,
}
#[derive(Debug, Serialize)]
pub struct VaultListResponse {
pub entries: Vec<VaultEntry>,
pub next_cursor: Option<String>,
pub total: u64,
}
#[derive(Debug, Serialize)]
pub struct VaultStatusResponse {
pub tenant_id: String,
pub note_count: u64,
pub total_size_bytes: u64,
pub index_version: String,
pub last_indexed_at: Option<String>,
pub health: String,
}
#[derive(Debug, Serialize)]
pub struct GraphEdge {
pub from: String,
pub to: String,
pub kind: String,
}
#[derive(Debug, Serialize)]
pub struct VaultGraphResponse {
pub nodes: Vec<String>,
pub edges: Vec<GraphEdge>,
}
pub type VaultLinksResponse = VaultGraphResponse;
#[derive(Debug, Serialize)]
pub struct TraceEntry {
pub path: String,
pub score: f32,
pub snippet: Option<String>,
pub tags: Vec<String>,
}
#[derive(Debug, Serialize)]
pub struct VaultTraceResponse {
pub entries: Vec<TraceEntry>,
}
#[derive(Debug, Serialize)]
pub struct VaultContextResponse {
pub context: String,
pub estimated_tokens: u32,
pub sources: Vec<String>,
}
#[derive(Debug, Serialize)]
pub struct VaultAuthorsResponse {
pub authors: Vec<AuthorEntry>,
}
#[derive(Debug, Serialize)]
pub struct AuthorEntry {
pub name: String,
pub note_count: u64,
}
#[derive(Debug, Serialize)]
pub struct VaultTagsResponse {
pub tags: Vec<TagEntry>,
}
#[derive(Debug, Serialize)]
pub struct TagEntry {
pub tag: String,
pub note_count: u64,
}
#[derive(Debug, Serialize)]
pub struct EnqueuedResponse {
pub job_id: i64,
pub status: &'static str,
pub poll_url: String,
}
#[derive(Debug, Serialize)]
pub struct EnqueuedResponseUlid {
pub job_id: String,
pub status: &'static str,
pub poll_url: String,
}
#[derive(Debug, Serialize)]
pub struct JobStatusResponse {
pub job_id: i64,
pub status: String,
pub attempts: i32,
pub last_error: Option<String>,
}