secureops_core/
runtime.rs1use crate::types::Severity;
9use serde::{Deserialize, Serialize};
10use std::collections::HashMap;
11
12#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
14#[serde(rename_all = "camelCase")]
15pub struct MonitorAlert {
16 pub timestamp: String,
17 pub severity: Severity,
18 pub monitor: String,
19 pub message: String,
20 #[serde(skip_serializing_if = "Option::is_none", default)]
21 pub details: Option<String>,
22}
23
24#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
26#[serde(rename_all = "camelCase")]
27pub struct MonitorStatus {
28 pub running: bool,
29 #[serde(skip_serializing_if = "Option::is_none", default)]
30 pub last_check: Option<String>,
31 pub alerts: Vec<MonitorAlert>,
32}
33
34#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
36#[serde(rename_all = "camelCase")]
37pub struct CostEntry {
38 pub timestamp: String,
39 pub model: String,
40 pub input_tokens: u64,
41 pub output_tokens: u64,
42 pub estimated_cost_usd: f64,
43}
44
45#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
47#[serde(rename_all = "camelCase")]
48pub struct CostReport {
49 pub hourly: f64,
50 pub daily: f64,
51 pub monthly: f64,
52 pub projection: CostProjection,
53 pub circuit_breaker_tripped: bool,
54 pub entries: Vec<CostEntry>,
55}
56
57#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
58#[serde(rename_all = "camelCase")]
59pub struct CostProjection {
60 pub daily: f64,
61 pub monthly: f64,
62}
63
64#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
66#[serde(rename_all = "camelCase")]
67pub struct SkillScanResult {
68 pub safe: bool,
69 pub skill_name: String,
70 pub findings: Vec<String>,
71 pub dangerous_patterns: Vec<String>,
72 pub ioc_matches: Vec<String>,
73}
74
75#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
77#[serde(rename_all = "camelCase")]
78pub struct BehavioralBaseline {
79 pub tool_call_frequency: HashMap<String, u64>,
80 pub typical_tools: Vec<String>,
81 pub typical_data_paths: Vec<String>,
82 pub window_minutes: u64,
83 pub last_updated: String,
84}
85
86#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
90#[serde(rename_all = "camelCase")]
91pub struct HardeningAction {
92 pub id: String,
93 pub description: String,
94 pub before: String,
95 pub after: String,
96}
97
98#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
100#[serde(rename_all = "camelCase")]
101pub struct HardeningResult {
102 pub module: String,
103 pub applied: Vec<HardeningAction>,
104 pub skipped: Vec<HardeningAction>,
105 pub errors: Vec<String>,
106}