* Get label for an agent block - show first non-empty line of the prompt.
(content: string)
| 50 | * Get label for an agent block - show first non-empty line of the prompt. |
| 51 | */ |
| 52 | function getAgentBlockLabel(content: string): string { |
| 53 | const lines = content.split('\n') |
| 54 | |
| 55 | for (const line of lines) { |
| 56 | const trimmed = line.trim() |
| 57 | if (trimmed) { |
| 58 | return truncate(`prompt: ${trimmed}`, MAX_LABEL_LENGTH) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return 'agent (empty prompt)' |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Get label for a code block - prefer first comment, fall back to first line. |
no test coverage detected