MCPcopy Create free account
hub / github.com/Noumena-Network/code / extractInboundAttachments

Function extractInboundAttachments

src/bridge/inboundAttachments.ts:43–49  ·  view source on GitHub ↗
(msg: unknown)

Source from the content-addressed store, hash-verified

41
42/** Pull file_attachments off a loosely-typed inbound message. */
43export function extractInboundAttachments(msg: unknown): InboundAttachment[] {
44 if (typeof msg !== 'object' || msg === null || !('file_attachments' in msg)) {
45 return []
46 }
47 const parsed = attachmentsArraySchema().safeParse(msg.file_attachments)
48 return parsed.success ? parsed.data : []
49}
50
51/**
52 * Strip path components and keep only filename-safe chars. file_name comes

Callers 2

resolveAndPrependFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected