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

Function extractImageAttachments

packages/opencode/src/acp/tool.ts:251–256  ·  view source on GitHub ↗
(attachments: ReadonlyArray<ToolAttachment>)

Source from the content-addressed store, hash-verified

249}
250
251export function extractImageAttachments(attachments: ReadonlyArray<ToolAttachment>): ImageAttachment[] {
252 return attachments.flatMap((attachment): ImageAttachment[] => {
253 const data = dataUrlImage(attachment)
254 return data ? [data] : []
255 })
256}
257
258export function shellOutputSnapshot(state: { readonly metadata?: unknown }) {
259 if (!state.metadata || typeof state.metadata !== "object") return undefined

Callers 2

tool.test.tsFile · 0.90
imageContentsFunction · 0.85

Calls 1

dataUrlImageFunction · 0.85

Tested by

no test coverage detected