The blob store backing storage-scale attachments, or null when this host supports only
inline ones.
Bind an implementation once at startup — the server binds MJStorage, a browser or React Native client can bind a GraphQL-backed one. Leaving it unbound is a supported configuration: inline attachments (the common case for an end user, who typically cannot write to MJStorage at all) work without it, and storage-backed operations report that clearly instead of the package failing to load.
Add a new attachment to a conversation detail. Handles validation, storage decision, thumbnail generation, and record creation.
The ID of the conversation detail
The attachment data and metadata
The AI agent (for limit overrides)
The AI model (for capability limits)
The current user context
Current attachment counts for validation
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
The result with created attachment or error
Create an AttachmentContent reference for embedding in messages. Maps from entity to the content block type used in AI messages.
The attachment entity
The attachment content reference
Delete an attachment and its underlying storage.
The attachment ID
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
Whether deletion succeeded
Downloads a stored file's content as base64.
Returns base64 rather than a Buffer so this service stays runtime-neutral — Buffer is a
Node global, and its presence in a shared signature is what made this class server-only.
Callers that genuinely need bytes convert at their own boundary.
The MJ: Files record id
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
Base64 content, or null when unavailable or no blob store is bound
Get attachment data with content URL. For inline attachments, returns the base64 data URL. For MJStorage attachments, returns a pre-authenticated download URL.
The attachment entity
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
The attachment with content URL
Get all attachments for a conversation detail.
The conversation detail ID
The current user context
Optionalprovider: IMetadataProviderArray of attachment entities
Get attachments for multiple conversation details (batch load).
Array of conversation detail IDs
The current user context
Optionalprovider: IMetadataProviderMap of conversation detail ID to attachments
Gets a pre-authenticated download URL for a stored file.
The MJ: Files record id
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
The URL, or null when unavailable or no blob store is bound
Service for managing conversation attachments. Handles validation, storage, thumbnails, and CRUD operations.