( s: string, )
| 57 | * Input is trimmed before matching. |
| 58 | */ |
| 59 | export function parseDataUri( |
| 60 | s: string, |
| 61 | ): { mediaType: string; data: string } | null { |
| 62 | const match = s.trim().match(DATA_URI_RE) |
| 63 | if (!match || !match[1] || !match[2]) return null |
| 64 | return { mediaType: match[1], data: match[2] } |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Build an image tool_result block from shell stdout containing a data URI. |
no outgoing calls
no test coverage detected