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

Function imageContents

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

Source from the content-addressed store, hash-verified

236}
237
238export function imageContents(attachments: ReadonlyArray<ToolAttachment>): ToolCallContent[] {
239 return extractImageAttachments(attachments).map((attachment): ToolCallContent => {
240 return {
241 type: "content",
242 content: {
243 type: "image",
244 mimeType: attachment.mimeType,
245 data: attachment.data,
246 },
247 }
248 })
249}
250
251export function extractImageAttachments(attachments: ReadonlyArray<ToolAttachment>): ImageAttachment[] {
252 return attachments.flatMap((attachment): ImageAttachment[] => {

Callers 2

tool.test.tsFile · 0.90
completedToolContentFunction · 0.85

Calls 1

extractImageAttachmentsFunction · 0.85

Tested by

no test coverage detected