(result: ScanResult, skillName: string)
| 170 | |
| 171 | /** Format a scan result for the CLI. Returns null when clean. */ |
| 172 | export function formatScanReport(result: ScanResult, skillName: string): string | null { |
| 173 | if (result.severity === 'clean') return null; |
| 174 | const head = result.severity === 'dangerous' |
| 175 | ? `\u26d4 Skill "${skillName}" failed the security scan (${result.findings.length} finding(s)):` |
| 176 | : `\u26a0\ufe0f Skill "${skillName}" has ${result.findings.length} suspicious finding(s):`; |
| 177 | const lines = result.findings.map(f => |
| 178 | ` [${f.severity}] ${f.rule}: ${f.detail}\n ↳ ${f.evidence}`, |
| 179 | ); |
| 180 | return [head, ...lines].join('\n'); |
| 181 | } |
no outgoing calls
no test coverage detected