Extend prompt execution contract

This commit is contained in:
2026-08-25 19:40:57 +00:00
parent b92f83e49b
commit 1b38f66240
8 changed files with 163 additions and 18 deletions

View File

@@ -78,3 +78,15 @@ func boundText(value string, limit int) string {
}
return value
}
func boundCodePoints(value string, limit int) string {
if limit <= 0 || value == "" {
return ""
}
value = strings.ToValidUTF8(value, "<22>")
runes := []rune(value)
if len(runes) <= limit {
return value
}
return string(runes[:limit])
}