upgrade Skill system auf regitry

This commit is contained in:
Sithies
2026-03-17 21:51:00 +01:00
parent 389c759166
commit 4e6b2c6759
28 changed files with 534 additions and 478 deletions
+14 -6
View File
@@ -234,15 +234,23 @@ fn split_message(text: &str) -> Vec<String> {
let mut remaining = text;
while remaining.len() > MAX_CHUNK_SIZE {
// Schnittpunkt suchen — bevorzugt Zeilenumbruch, dann Leerzeichen
let cut = remaining[..MAX_CHUNK_SIZE]
// Sicherstellen dass wir auf einer char-Grenze starten
let safe_max = {
let mut idx = MAX_CHUNK_SIZE;
while !remaining.is_char_boundary(idx) {
idx -= 1;
}
idx
};
let cut = remaining[..safe_max]
.rfind('\n')
.or_else(|| remaining[..MAX_CHUNK_SIZE].rfind(". "))
.or_else(|| remaining[..MAX_CHUNK_SIZE].rfind(' '))
.unwrap_or(MAX_CHUNK_SIZE);
.or_else(|| remaining[..safe_max].rfind(". "))
.or_else(|| remaining[..safe_max].rfind(' '))
.unwrap_or(safe_max);
chunks.push(remaining[..cut].trim().to_string());
remaining = remaining[cut..].trim_start();
remaining = &remaining[cut..].trim_start();
}
if !remaining.is_empty() {