(stdout: &str, stderr: &str)
| 1181 | } |
| 1182 | |
| 1183 | fn summarize_command_output(stdout: &str, stderr: &str) -> String { |
| 1184 | let primary = if !stdout.trim().is_empty() { |
| 1185 | stdout.trim() |
| 1186 | } else { |
| 1187 | stderr.trim() |
| 1188 | }; |
| 1189 | |
| 1190 | if primary.is_empty() { |
| 1191 | return "Skill downloaded successfully.".to_string(); |
| 1192 | } |
| 1193 | |
| 1194 | truncate_preview(primary) |
| 1195 | } |
| 1196 | |
| 1197 | fn truncate_preview(text: &str) -> String { |
| 1198 | if text.chars().count() <= MAX_OUTPUT_PREVIEW_CHARS { |
no test coverage detected