AssetStore

interface AssetStore

Application-supplied SPI for storing and resolving durable asset content.

Implementations may use a filesystem, object storage, database, or another blob store. Conversation stores should persist DurableAsset metadata, not the content bytes. Unlike AssetTracker, which tracks assets in a live conversation, an AssetStore owns content beyond the lifetime of the process that created it.

Durable asset tracking is opt-in: callers must supply a configured store when wrapping tools that produce materializable assets.

Inheritors

Functions

Link copied to clipboard
abstract fun delete(asset: DurableAsset)

Delete content represented by asset. Retention policy is implementation-specific.

Link copied to clipboard
abstract fun open(asset: DurableAsset): InputStream

Open the content represented by asset. The caller must close the returned stream.

Link copied to clipboard
abstract fun store(asset: MaterializableAsset): DurableAsset

Copy asset content to durable storage before its original location expires. The implementation derives DurableAsset.sizeBytes and DurableAsset.contentHash while copying the stream.