1use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8pub struct PromptFile {
9 pub path: String,
10 pub sha256: String,
11 pub bytes: u64,
12}
13
14#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
16pub struct PromptSnapshot {
17 pub fingerprint: String,
19 pub captured_at_ms: u64,
20 pub files_json: String,
22 pub total_bytes: u64,
23}
24
25impl PromptSnapshot {
26 pub fn files(&self) -> Vec<PromptFile> {
27 serde_json::from_str(&self.files_json).unwrap_or_default()
28 }
29}
30
31#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
33pub struct PromptDiff {
34 pub added: Vec<String>,
35 pub removed: Vec<String>,
36 pub changed: Vec<String>,
37}
38
39impl PromptDiff {
40 pub fn is_empty(&self) -> bool {
41 self.added.is_empty() && self.removed.is_empty() && self.changed.is_empty()
42 }
43}