(link: ResourceLink)
| 151 | } |
| 152 | |
| 153 | function resourceLinkToPart(link: ResourceLink): PromptPart { |
| 154 | const parsed = uriToFilePart(link.uri, link.mimeType ?? "text/plain", link.name) |
| 155 | if (parsed.type === "file") return parsed |
| 156 | return { type: "text", text: parsed.text } |
| 157 | } |
| 158 | |
| 159 | function uriToFilePart( |
| 160 | uri: string, |
no test coverage detected