MCPcopy Create free account
hub / github.com/anomalyco/opencode / resourceLinkToPart

Function resourceLinkToPart

packages/opencode/src/acp/content.ts:153–157  ·  view source on GitHub ↗
(link: ResourceLink)

Source from the content-addressed store, hash-verified

151}
152
153function 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
159function uriToFilePart(
160 uri: string,

Callers 1

contentBlockToPartsFunction · 0.85

Calls 1

uriToFilePartFunction · 0.85

Tested by

no test coverage detected