Skip to Content

FileWithData

Defined in: src/lib/processors/types.ts:6 

Extended file metadata with data URL for processing

Extends

Properties

dataUrl

dataUrl: string

Defined in: src/lib/processors/types.ts:8 

Data URL or blob URL containing file content


id

id: string

Defined in: src/lib/db/chat/types.ts:48 

Unique identifier for the file (used as OPFS key for cached files)

Inherited from

FileMetadata.id


name

name: string

Defined in: src/lib/db/chat/types.ts:50 

Display name of the file

Inherited from

FileMetadata.name


size

size: number

Defined in: src/lib/db/chat/types.ts:54 

File size in bytes

Inherited from

FileMetadata.size


sourceUrl?

optional sourceUrl: string

Defined in: src/lib/db/chat/types.ts:70 

Original external URL for files downloaded and cached locally (e.g., from MCP R2). Used purely for URL→OPFS mapping to enable fallback when the source returns 404.

This is metadata for local lookup only - it is NOT sent to the AI or rendered directly. The file content is served from OPFS using the id field.

Inherited from

FileMetadata.sourceUrl


type

type: string

Defined in: src/lib/db/chat/types.ts:52 

MIME type (e.g., “image/png”)

Inherited from

FileMetadata.type


url?

optional url: string

Defined in: src/lib/db/chat/types.ts:62 

Content URL to include when sending this message to the AI. When present, this URL is added as an image_url content part. Typically used for user-uploaded files (data URIs) that should be sent with the message.

NOT used for MCP-cached files - those use sourceUrl for lookup and render from OPFS.

Inherited from

FileMetadata.url

Last updated on