Function
firstText
(input: readonly unknown[] | undefined)
Source from the content-addressed store, hash-verified
| 186 | } |
| 187 | |
| 188 | function firstText(input: readonly unknown[] | undefined): string { |
| 189 | if (!input) return ''; |
| 190 | for (const part of input) { |
| 191 | if (part && typeof part === 'object' && (part as { type?: string }).type === 'text') { |
| 192 | return (part as { text?: string }).text ?? ''; |
| 193 | } |
| 194 | } |
| 195 | return ''; |
| 196 | } |
| 197 | |
| 198 | function outputSize(output: unknown): number { |
| 199 | if (typeof output === 'string') return output.length; |
Tested by
no test coverage detected