ai_agent/utils/
release_notes.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct ReleaseNote {
8 pub version: String,
9 pub date: String,
10 pub changes: Vec<Change>,
11}
12
13#[derive(Debug, Clone, Serialize, Deserialize)]
15pub enum ChangeType {
16 Added,
17 Changed,
18 Deprecated,
19 Removed,
20 Fixed,
21 Security,
22}
23
24#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct Change {
27 pub change_type: ChangeType,
28 pub description: String,
29}
30
31pub fn parse_release_notes(markdown: &str) -> Vec<ReleaseNote> {
33 let mut notes = Vec::new();
34
35 for line in markdown.lines() {
37 if line.starts_with("## ") && line.contains("v") {
38 let version = line
40 .trim_start_matches("## ")
41 .trim_start_matches("v")
42 .split_whitespace()
43 .next()
44 .unwrap_or("0.0.0")
45 .to_string();
46
47 notes.push(ReleaseNote {
48 version,
49 date: String::new(),
50 changes: Vec::new(),
51 });
52 }
53 }
54
55 notes
56}