Skip to content
1 min read · 220 words

Interface: OpfsSpoolStoreOptions

Defined in: batteries/storage/opfs/index.ts:370

Constructor options for OpfsSpoolStore.

Properties

PropertyTypeDefault valueDescriptionDefined in
directory?() => Promise<OpfsDirectoryHandle>undefinedOptional thunk that resolves the OpfsDirectoryHandle used as the store root. Remarks When omitted, the store resolves the root via navigator.storage.getDirectory() on its first filesystem call. Override for tests (to point at a per-suite subdirectory) or to scope the store to a nested directory inside OPFS. The thunk is invoked at most once per store; the returned handle is memoised.batteries/storage/opfs/index.ts:381
keyPrefix?string""Optional filename prefix prepended to every callId. Remarks Prefix is a filename prefix, not a subdirectory — keyPrefix: 'agent-runs/' produces a file literally named agent-runs/<callId> at the root, not a nested directory. (OPFS filenames may not contain /, so use a non-/ separator like - if you want a flat namespace.) This mirrors the keyPrefix semantics in the flydrive and in-memory batteries.batteries/storage/opfs/index.ts:394
streamThresholdBytes?number10 * 1024 * 1024 (10 MiB)Default streamThresholdBytes for readers produced by write() and read(). Individual calls may override via their own opts argument.batteries/storage/opfs/index.ts:402