(fileName: string)
| 84 | } |
| 85 | |
| 86 | function parseFileName(fileName: string): { name: string; extension: string } { |
| 87 | // Split the string at the last dot |
| 88 | const lastDotIndex = fileName.lastIndexOf("."); |
| 89 | if (lastDotIndex === -1) { |
| 90 | // No dot found |
| 91 | return { name: fileName, extension: "" }; |
| 92 | } |
| 93 | return { |
| 94 | name: fileName.slice(0, lastDotIndex), |
| 95 | extension: fileName.slice(lastDotIndex + 1), |
| 96 | }; |
| 97 | } |
| 98 | |
| 99 | // New: Parse an assistant reply into ordered text and file segments. |
| 100 | // Supports multiple files per reply and interleaved text. Streaming-safe: returns |
no outgoing calls
no test coverage detected