Function: createAttachmentArtifacts()
Makaio Framework / services-core / createAttachmentArtifacts
Function: createAttachmentArtifacts()
Section titled “Function: createAttachmentArtifacts()”createAttachmentArtifacts(
storeArtifact,sessionId,messageId,blocks):Promise<void>
Defined in: ../../../packages/services/core/src/session/attachment-artifacts.ts:84
Creates session-scoped artifacts for attachment blocks in a user message.
Called after message storage. Delegates persistence to storeArtifact so
this function remains free of host plugin dependencies — the host
(host layer) owns the storage subject and wires the bus call.
Breaking change: previously accepted IMakaioBus and relied on the
artifacts storage subject from @makaio/contracts. The callback signature
decouples the framework from that bus + subject wiring.
Each attachment block becomes a user-upload artifact in the session scope,
with metadata linking it back to the originating message.
Parameters
Section titled “Parameters”storeArtifact
Section titled “storeArtifact”Host-provided callback to persist one artifact
sessionId
Section titled “sessionId”string
Session containing the message
messageId
Section titled “messageId”string
Message containing the attachments
blocks
Section titled “blocks”({ content: string; type: "text"; } | { source: { data: string; mimeType: string; type: "base64"; } | { mimeType?: string; type: "url"; url: string; }; type: "image"; } | { source: { data: string; mimeType: string; type: "base64"; } | { mimeType?: string; type: "url"; url: string; }; type: "document"; } | { attachmentType: "file" | "directory"; displayName?: string; fileName: string; filePath: string; source: { data: string; mimeType: string; type: "base64"; } | { mimeType?: string; type: "url"; url: string; }; type: "attachment"; } | { content: string; metadata?: Record<string, unknown>; type: "reasoning"; } | { args: Record<string, unknown>; name: string; toolCallId: string; type: "tool_call"; } | { isError?: boolean; output: string; toolCallId: string; type: "tool_output"; })[]
Normalized message blocks (already stored)
Returns
Section titled “Returns”Promise<void>