MCPcopy Index your code
hub / github.com/simstudioai/sim / fetchAttachments

Function fetchAttachments

apps/sim/lib/mothership/inbox/executor.ts:188–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186 }
187
188 const fetchAttachments = async () => {
189 let attachments: AgentMailAttachment[] = []
190 if (inboxTask.hasAttachments && ws.inboxProviderId && inboxTask.agentmailMessageId) {
191 try {
192 const fullMessage = await agentmail.getMessage(
193 ws.inboxProviderId,
194 inboxTask.agentmailMessageId
195 )
196 attachments = fullMessage.attachments || []
197 } catch (attachErr) {
198 logger.warn('Failed to fetch attachment metadata', { taskId, attachErr })
199 }
200 }
201 const downloaded = await downloadAttachmentContents(
202 attachments,
203 ws.inboxProviderId,
204 inboxTask.agentmailMessageId,
205 taskId,
206 userId
207 )
208 return { attachments, ...downloaded }
209 }
210
211 const [attachmentResult, workspaceContext, integrationTools, userSkillTool, userPermission] =
212 await Promise.all([

Callers 1

executeInboxTaskFunction · 0.70

Calls 2

warnMethod · 0.65

Tested by

no test coverage detected