MCPcopy Index your code
hub / github.com/anomalyco/opencode / imgMsg

Function imgMsg

packages/opencode/src/plugin/github-copilot/copilot.ts:31–43  ·  view source on GitHub ↗
(msg: any)

Source from the content-addressed store, hash-verified

29
30// Check if a message is a synthetic user msg used to attach an image from a tool call
31function imgMsg(msg: any): boolean {
32 if (msg?.role !== "user") return false
33
34 // Handle the 3 api formats
35
36 const content = msg.content
37 if (typeof content === "string") return content === MessageV2.SYNTHETIC_ATTACHMENT_PROMPT
38 if (!Array.isArray(content)) return false
39 return content.some(
40 (part: any) =>
41 (part?.type === "text" || part?.type === "input_text") && part.text === MessageV2.SYNTHETIC_ATTACHMENT_PROMPT,
42 )
43}
44
45function fix(model: Model, url: string): Model {
46 return {

Callers 1

fetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected