1use serde::{Deserialize, Serialize};
8
9use crate::event::{
10 ExtensionCategory, LocationType, NetworkType, RingerMode, SemanticHint, SourceTier,
11};
12use crate::sanitized::SanitizedEvent;
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
18pub struct StructuredContext {
19 pub window_id: String,
21 pub window_start_ms: i64,
23 pub window_end_ms: i64,
25 pub duration_secs: u32,
27 pub events: Vec<SanitizedEvent>,
29 pub summary: ContextSummary,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct ContextSummary {
36 pub foreground_apps: Vec<String>,
38 pub notified_apps: Vec<String>,
40 pub all_semantic_hints: Vec<SemanticHint>,
42 pub file_activity: Vec<(ExtensionCategory, u32)>,
44 pub latest_system_status: Option<SystemStatusSnapshot>,
46 pub source_tier: SourceTier,
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize)]
52pub struct SystemStatusSnapshot {
53 pub battery_pct: Option<u8>,
54 pub is_charging: bool,
55 pub network: NetworkType,
56 pub ringer_mode: RingerMode,
57 pub location_type: LocationType,
58 pub headphone_connected: bool,
59}