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

Function decodeDataUrl

packages/opencode/src/acp/content.ts:241–245  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

239}
240
241function decodeDataUrl(url: string) {
242 const match = /^data:([^;]+);base64,(.*)$/.exec(url)
243 if (!match) return
244 return { mime: match[1], base64: match[2] }
245}
246
247function audienceFlags(audience: readonly Role[] | null | undefined) {
248 if (audience?.length === 1 && audience[0] === "assistant") return { synthetic: true }

Callers 1

filePartToContentChunksFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected